🧪 CI: upload coverage on pushes to master too - #2023
Merged
Merged
Conversation
The Codecov upload steps required github.event.pull_request.head.repo to equal the repository, a guard against fork pull requests (#1229) that has no value on a push event, so every upload on master was skipped (measured on the run for cc0ffe0: all five "upload to Codecov" steps skipped). Codecov then compared every pull request against the newest ancestor with a report, 35 commits back and from before the sphinx-test-reports split (#2009), so the reports flag read -0.74% on pull requests that never touched the package. The guard now applies to pull request events only, a push to master uploads under its own secrets, and fail_ci_if_error is limited to pull requests so that a Codecov outage cannot turn master red.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2023 +/- ##
==========================================
+ Coverage 91.69% 91.87% +0.17%
==========================================
Files 129 129
Lines 18155 18084 -71
==========================================
- Hits 16648 16614 -34
+ Misses 1507 1470 -37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every Codecov upload step is guarded by
github.event.pull_request.head.repo.full_name == github.repository, a guard against fork pull requests (#1229, August 2024) that has no value on a push event. So no push to master has uploaded a report since then; measured on the CI run forcc0ffe0, all five "upload to Codecov" steps are skipped.Codecov compares a pull request against the newest ancestor that has a report. That ancestor is now
d68d10d, 35 commits back and from before the sphinx-test-reports split (#2009), which moved statements out of thereportsflag, socodecov/project/reportsreads as a coverage drop (−0.74%) on every pull request, including ones that never touch the package (#2020 is the current example). A looser threshold incodecov.ymlwould hide this one delta while the base kept drifting; the cause is the missing upload.What changes
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository). A push to master uploads under the repository's own secrets; the dependabot and repository checks are unchanged.fail_ci_if_erroris limited to pull requests, so a Codecov outage cannot turn master red.CODECOV_TOKENsecret descriptions say when the steps read it.What to expect
The first push to master after this merges uploads a fresh report; pull requests opened or rebased after that compare against it. Pull requests whose base is older, #2020 included, keep their current
reportsstatus until they rebase or merge; it is not a finding about them.Split out of #2020 at review's request; that branch reverts its copy of the change.
Generated by Claude Code