Repository navigation
ci: skip Codecov upload on failed branch builds - #4260
Merged
Merged
Conversation
A failed run on master (or release) reports only partial coverage, since the report is merged from whatever the aborted test step collected. Codecov treats that as the new project baseline, so the global coverage drops and PR diffs compare against a poisoned reference. Upload coverage on branch builds only when tests pass, so PR diffs compare against the last successful branch run. Pull requests still upload even after a test failure, so a PR shows how much of the changed code is already covered. The post-failure report rebuild now runs on pull requests only, since a failed branch build no longer uploads. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4260 +/- ##
============================================
- Coverage 70.85% 70.83% -0.03%
+ Complexity 5332 5325 -7
============================================
Files 244 244
Lines 21973 21973
Branches 3692 3692
============================================
- Hits 15570 15564 -6
- Misses 4746 4748 +2
- Partials 1657 1661 +4 🚀 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.
Why
When a test run on
master(orrelease) fails, the coverage step still uploads to Codecov. The report is merged from whatever the aborted test step managed to collect, so it covers only part of the code. Codecov treats that partial report as the new project baseline: the global project coverage drops, and every subsequent PR diff compares against this poisoned reference and shows misleading numbers.What
push/workflow_dispatch, includingmasterandrelease) upload coverage only when tests pass, so PR diffs compare against the last successful branch run.Behaviour matrix:
pull_requestpush/workflow_dispatchHow to verify
masterbuild with a green test job: coverage uploads as before.masterbuild with a failing test job: no Codecov upload, baseline stays at the last successful run.🤖 Generated with Claude Code