Skip to content

Add a check mode for the CodeScene PR coverage gate#334

Merged
leynos merged 1 commit into
mainfrom
codescene-check-mode
Jul 9, 2026
Merged

Add a check mode for the CodeScene PR coverage gate#334
leynos merged 1 commit into
mainfrom
codescene-check-mode

Conversation

@leynos

@leynos leynos commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

This branch adds a mode input to upload-codescene-coverage so the
action can drive CodeScene's pull-request coverage gate. Testing the
estate rollout on leynos/mxd#362
showed cs-coverage upload is rejected for PR heads ("CodeScene only
analyse 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 and
evaluates changed-line coverage — verified locally against the mxd
project (Code coverage gates: PASS, exit 0) with CS_PROJECT_URL
set.

mode: check requires the new project-url input (exported as
CS_PROJECT_URL), a fetch-depth: 0 checkout so the merge base is
reachable, and, for LCOV, a report file ending in .info (the CLI
infers the format from the extension); the action validates all of
this before invoking the CLI. mode: upload (the default) is
byte-for-byte the existing behaviour.

Review walkthrough

Validation

  • make lint (action-validator over all action manifests): clean.
  • make test: 997 passed, 14 skipped.
  • cs-coverage check --coverage-files <file>.info with
    CS_ACCESS_TOKEN + CS_PROJECT_URL run locally from an mxd clone:
    Code coverage gates: PASS, exit 0.

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ade76e63-5720-4758-938e-6c21241397dc

📥 Commits

Reviewing files that changed from the base of the PR and between 158d04f and 0240dca.

📒 Files selected for processing (3)
  • .github/actions/upload-codescene-coverage/CHANGELOG.md
  • .github/actions/upload-codescene-coverage/README.md
  • .github/actions/upload-codescene-coverage/action.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codescene-check-mode

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

@leynos leynos merged commit 927edd4 into main Jul 9, 2026
27 checks passed
@leynos leynos deleted the codescene-check-mode branch July 9, 2026 11:44
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