Skip to content

ci: skip Codecov upload on failed branch builds - #4260

Merged
vlsi merged 1 commit into
pgjdbc:masterfrom
vlsi:claude/mystifying-buck-d5c734
Jun 26, 2026
Merged

vlsi merged 1 commit into
pgjdbc:masterfrom
vlsi:claude/mystifying-buck-d5c734

Conversation

@vlsi

@vlsi vlsi commented Jun 26, 2026

Copy link
Copy Markdown
Member

Why

When a test run on master (or release) 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

  • Branch builds (push / workflow_dispatch, including master and release) upload coverage only when tests pass, so PR diffs compare against the last successful branch run.
  • Pull requests still upload coverage even after a test failure, so a PR shows how much of the changed code is already covered.
  • The post-failure report rebuild ("Build coverage report after a test failure") now runs on pull requests only — a failed branch build no longer uploads, so rebuilding the report there would be wasted CI time.

Behaviour matrix:

Event Tests pass Tests fail
pull_request upload upload
push / workflow_dispatch upload skip

How to verify

  • master build with a green test job: coverage uploads as before.
  • master build with a failing test job: no Codecov upload, baseline stays at the last successful run.
  • PR with a failing test job: coverage still uploads, so the PR diff shows partial coverage of the changed code.

🤖 Generated with Claude Code

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

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.83%. Comparing base (5ef0883) to head (11d4efe).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vlsi vlsi added the chore label Jun 26, 2026
@vlsi
vlsi merged commit 81b719d into pgjdbc:master Jun 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant