Skip to content

fix(coverage): skip cleanly when PR head branch was deleted by auto-merge#204

Merged
fredbi merged 1 commit into
masterfrom
fix/coverage-skip-on-deleted-branch
May 31, 2026
Merged

fix(coverage): skip cleanly when PR head branch was deleted by auto-merge#204
fredbi merged 1 commit into
masterfrom
fix/coverage-skip-on-deleted-branch

Conversation

@fredbi
Copy link
Copy Markdown
Member

@fredbi fredbi commented May 31, 2026

The collect-coverage job is intentionally not a required check (codecov uploads are flaky), so auto-merge can fire before it runs. When that happens, GitHub's auto-delete-branch policy removes the PR head and the checkout step fails with a noisy "Reference not found" error, leaving a red status on an otherwise successful merge.

Add a precheck step that queries the GitHub API for the head branch. If it's gone, emit a notice and gate the remaining steps off, so the job conclusion stays green. Normal PRs (branch still exists) are unaffected -- coverage is still uploaded and real failures still surface.

collect-reports.yml does not need the same fix: it has no checkout step (downloads artifacts by run_id, uses head.sha as a literal value).

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

…erge

The collect-coverage job is intentionally not a required check (codecov
uploads are flaky), so auto-merge can fire before it runs. When that
happens, GitHub's auto-delete-branch policy removes the PR head and the
checkout step fails with a noisy "Reference not found" error, leaving a
red status on an otherwise successful merge.

Add a precheck step that queries the GitHub API for the head branch.
If it's gone, emit a notice and gate the remaining steps off, so the
job conclusion stays green. Normal PRs (branch still exists) are
unaffected -- coverage is still uploaded and real failures still
surface.

collect-reports.yml does not need the same fix: it has no checkout
step (downloads artifacts by run_id, uses head.sha as a literal value).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (66b76c4) to head (eeb779a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #204   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           14        14           
=========================================
  Hits            14        14           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fredbi fredbi merged commit 7a1bb6c into master May 31, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant