Skip to content

ci(coverage): reuse test artifacts after partial reruns - #404

Merged
scttbnsn merged 3 commits into
dev/v1.0from
fix/ci-coverage-reuse
Oct 25, 2026
Merged

scttbnsn merged 3 commits into
dev/v1.0from
fix/ci-coverage-reuse

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Partial GitHub Actions reruns can reuse Build & Test from an earlier attempt. The Codecov job currently asks for an artifact named after its own attempt, so it can miss the existing profile and stay green without uploading anything. Run 40099590235 demonstrated this: the producer uploaded go-test-40099590235-1, while the downstream rerun requested go-test-40099590235-2.

Resolve the latest unexpired producer artifact at or before the current attempt, verifying the run and intended head, then download its exact artifact ID. Missing or empty coverage now produces an explicit error and skips the upload. The existing race/97% coverage floor, required Codecov patch check, job permissions and non-gating upload policy remain in place.

Validation: the full normal local pre-push gate passed on f525b52d, including fresh Go race tests, all ten fuzz smoke targets, GoReleaser snapshot without publication or Docker, configured Qlty, Go/workflow linters, govulncheck, 192 combined contract tests plus eight website-header tests, static builds and both Lighthouse budgets. All eight focused artifact/profile regressions pass, including six first-failing artifact-selection cases, missing/empty/present profile guards and a no-op counterfactual. The resolver selected the real attempt-1 artifact in a read-only check of the original attempt-2 case. Hosted delivery on this implementation commit remains to be verified.

Review scope: three CI/test files. Threat model is a public Go repository's CI reporting path; artifact metadata must identify the current run/head and is treated as data. This change does not alter runtime Docker authority or branch protection. Base is merged dev commit 48cb9a16 from PR #402. The local ancestry-only restack preserved the previously tested tree; hosted delivery on this exact implementation head remains pending.

Changelog

  • 🐛 Fixed coverage uploads after partial reruns. The Codecov job now selects the latest unexpired Go test artifact from the current run and intended commit, then downloads it by artifact ID.
  • 🔧 Changed coverage validation to reject missing or empty profiles and skip upload when artifact resolution, download, or validation fails. Upload remains non-gating.
  • ✨ Added resolver and workflow-guard regression tests for artifact selection, invalid candidates, and missing, empty, or present profiles.

Concerns

  • Hosted delivery on the implementation head remains pending.
  • The supplied context reports that focused regressions passed; it does not provide test-run output to verify that result.

@scttbnsn scttbnsn added the second-opinion Summon Greptile for a second-opinion review label Oct 25, 2026
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 48cb9a1 and f525b52.

Files selected for processing: 3
  • .github/workflows/ci-verify.yml
  • scripts/ci/resolve-go-coverage.sh
  • scripts/coverage-artifact.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The CI workflow now resolves a Go coverage artifact for the expected commit and downloads it by artifact ID. A validation step checks that artifacts/go-test/coverage.out exists and is non-empty. Codecov upload runs only after successful validation. The new resolver validates run identity and artifact eligibility. Tests cover artifact selection, invalid candidates, and profile validation.

Priority: Normal

Change: Bug fix

Merge Risk: Minimal · up to f525b

No confirmed issue blocks merging. Hosted coverage delivery has not yet been independently verified.

Pre-merge checks: Passed 2
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

@greptileai Review exact head f525b52debd491d4a1f79e8e57b0c7153e0a7ff6. Review for correctness, security issues, and cross-file regressions.

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

The PR lets Codecov reuse coverage from an earlier producer attempt after a partial rerun.

  • Coverage reruns find the matching test artifact before uploading.

Reviews (1) · Last reviewed commit: "style(ci): match Qlty shell simplificati..." · Reviewed by Greptile

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@biggest-littlest biggest-littlest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the coverage resolver and workflow guards at f525b52. All named checks are green, CodeRabbit and Greptile covered this head without actionable findings, and Codecov confirms the intended-head upload. Keep the normal merge and release gates.

@ALARGECOMPANY ALARGECOMPANY left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the exact-head CI and coverage evidence at f525b52: artifact12606536644, producer attempt2, one uploaded profile and a complete Codecov report. The bounded recovery passed; no gate, permission or protection was weakened.

@scttbnsn
scttbnsn merged commit 391b864 into dev/v1.0 Oct 25, 2026
59 of 64 checks passed
@scttbnsn
scttbnsn deleted the fix/ci-coverage-reuse branch November 6, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

second-opinion Summon Greptile for a second-opinion review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants