Upload coverage for merge queue commits so Codecov compares against the right base - #4403
Upload coverage for merge queue commits so Codecov compares against the right base#4403DonOmalVindula wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 8 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Purpose
Make Codecov's own patch coverage number correct, so the patch coverage gate can rely on it instead of computing patch coverage locally.
Refs #4268.
Codecov's patch total currently describes a wider range of commits than the pull request. On #4397, a CI-only change, Codecov reported 100% patch coverage: it compared head
7e9cb078against baseddfe60e0instead of the branch point586dc497, and the two covered lines it counted came frombackend/internal/idp/{constants,utils}.goin an unrelated commit. Across the open pull requests where the base can be checked, Codecov's comparison base matched the branch point in 0 of 6, with the same stale base reused across unrelated pull requests (54a48822for #4398 and #4358,08795e4efor #4390 and #4380).Root cause
All four Codecov uploads were skipped on
merge_group, andpr-builder.ymlis the only workflow that uploads coverage, so no coverage was ever uploaded for a main commit:So the wrong numbers were not a Codecov defect and not a flaw in the local computation; they were caused by our own pipeline never giving Codecov a report for main.
Approach
The
if: github.event_name != 'merge_group'guard is removed from the four upload steps (backend unit, console, gate, and the integration matrix). A merge queue run already executes all of those jobs, so it now produces the same six uploads a pull request does, matchingafter_n_builds: 6in codecov.yml. Every commit that lands on main gets a complete report, and Codecov's base for later pull requests becomes the branch point.codecov-merge-queue-statusstays. Its purpose narrows to what it actually guards: Codecov not reporting a status back on a queue commit in time. The comment is updated accordingly, since its previous wording implied queue commits cannot carry coverage data at all.Effect
Once main commits carry reports, Codecov compares each pull request against its branch point, its patch total describes that pull request's diff, and the gate's Codecov path becomes authoritative. The base check added in #4397 then passes instead of handing over to the local computation, so the local path returns to being a fallback for when Codecov is unavailable. This is also the precondition for retiring the custom gate entirely.
The effect is not retroactive: bases correct themselves as commits land on main with reports.
Risk
With a real report present, Codecov may begin posting statuses on queue commits, which could race the
codecov-merge-queue-statusstamp if it later reports a different result.codecov/patchis currently not a required check and is not posting at all, so this is theoretical today, but it is worth watching on the first few queue entries after this merges.Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks