feat(ci): sonar-rating-gate reusable workflow (mnab composite gradient) - #7
Merged
Conversation
Adds sonar-rating-gate.yml: a required-check that enforces SonarCloud's
overall New-Code composite (rating worst-of-three + duplication + coverage)
per PR target branch, along the mnab maturity gradient — after>=C/dup<=5%/
coverage-advisory, next>=B/dup<=3%/cov>=80%, main/before=A/dup<=3%/cov>=80%.
Independent of go-bash-ci.yml/mnab-gate.yml (reads a SonarCloud API measure,
runs no tests, applies to any language). Structural no-permanent-block
guarantees: an absent new_coverage metric (no coverage tool instrumented)
is treated as not-enforceable rather than a failing 0%, and a PR with no
New Code (docs-only) is treated as no-analysis rather than blocked.
docs/ci.md documents the composite table, consumption snippet, and the
required-check context (`sonar-gate / rating-gate`) branch protection needs.
Contract: dante-ops/docs/sonar-rating-gate-per-branch.md ("The gate: OVERALL
composite, per target branch", operator decision 2026-07-16). Sequenced with
the mnab CI-grind-gradient (board e49a2354) — separate mechanism, same
gradient principle.
Verified: actionlint clean (incl. embedded shellcheck) on both the new file
and the full workflows directory.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds
sonar-rating-gate.yml— a reusable, org-level required-check thatgates a PR's merge on SonarCloud's overall New-Code composite (rating
worst-of-three + duplication + coverage) for the PR's target (base)
branch, along the same mnab maturity gradient as
mnab-gate.yml.afternextmainbeforeIndependent of
go-bash-ci.yml/mnab-gate.yml— reads SonarCloud APImeasures, runs no tests, so it applies to any language SonarCloud analyzes.
Structural no-permanent-block guarantees: a repo without coverage
instrumentation is never permanently blocked by the coverage axis (an
absent
new_coveragemetric is treated as not-enforceable, not a failing0%); a PR with no New Code (docs-only) is treated as no-analysis (see
fail-if-no-analysis), so it passes rather than blocking on an empty diff.docs/ci.mddocuments the composite table, the consumption snippet, andthe required-check context (
sonar-gate / rating-gate) that branchprotection / the org ruleset needs to require.
Contract
dante-ops/docs/sonar-rating-gate-per-branch.md, section "The gate:OVERALL composite, per target branch" (operator decision 2026-07-16).
Sequenced with the in-flight mnab CI-grind-gradient rollout (board
e49a2354) — a separate mechanism (Sonar composite, not test/lint), samegradient principle, deliberately not duplicating that work.
What this PR does NOT do (gated, handed to the operator separately)
SONAR_TOKENas an Actions secret — admin-plane,operator does this. Agents do not enumerate the secret store for it.
entries — exact
gh apicommands are handed to the operator alongsidethis PR (see the DECISIONS.md draft PR in
.github-private).Test plan
actionlintclean onsonar-rating-gate.yml(including embeddedshellcheck via
run:blocks) and on the full workflows directory.SONAR_TOKENis provisioned (project key confirmed:alfred-intelligence_centralstation, orgalfred-intelligence).gh apicommands, then verify a sub-threshold PR is actuallyblocked.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com