Add a check mode for the CodeScene PR coverage gate#334
Conversation
Running the estate coverage rollout against leynos/mxd#362 showed that `cs-coverage upload` is rejected for pull-request heads: CodeScene only accepts uploads for branches the project analyses (typically `main`), so the "Code Coverage" PR check can never be satisfied by an upload. The PR gate is driven by `cs-coverage check`, which diffs the PR against its merge base and evaluates changed-line coverage. Add a `mode` input (`upload` | `check`) to the action. Check mode requires the new `project-url` input, exported as `CS_PROJECT_URL`, and a `fetch-depth: 0` checkout so the merge base is reachable; for LCOV the report file must end in `.info` because the CLI infers the format from the extension, and the action validates this before invoking the CLI.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 18 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. 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: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
This branch adds a
modeinput toupload-codescene-coverageso theaction can drive CodeScene's pull-request coverage gate. Testing the
estate rollout on leynos/mxd#362
showed
cs-coverage uploadis rejected for PR heads ("CodeScene onlyanalyse the following branches: (main)"): uploads are only accepted for
analysed branches, so the "CodeScene Code Coverage" PR check can never
be satisfied that way. The PR gate is instead driven by
cs-coverage check, which diffs the PR against its merge base andevaluates changed-line coverage — verified locally against the mxd
project (
Code coverage gates: PASS, exit 0) withCS_PROJECT_URLset.
mode: checkrequires the newproject-urlinput (exported asCS_PROJECT_URL), afetch-depth: 0checkout so the merge base isreachable, and, for LCOV, a report file ending in
.info(the CLIinfers the format from the extension); the action validates all of
this before invoking the CLI.
mode: upload(the default) isbyte-for-byte the existing behaviour.
Review walkthrough
— the
mode/project-urlinputs, extended validation, theconditional export of
CS_PROJECT_URL, and the new gated"Check coverage against CodeScene gates" step.
and CHANGELOG
document the two modes and their requirements.
Validation
make lint(action-validator over all action manifests): clean.make test: 997 passed, 14 skipped.cs-coverage check --coverage-files <file>.infowithCS_ACCESS_TOKEN+CS_PROJECT_URLrun locally from an mxd clone:Code coverage gates: PASS, exit 0.