Skip to content

feat(ci): sonar-rating-gate reusable workflow (mnab composite gradient) - #7

Merged
GeGGe01 merged 1 commit into
mainfrom
feat/sonar-rating-gate
Jul 16, 2026
Merged

feat(ci): sonar-rating-gate reusable workflow (mnab composite gradient)#7
GeGGe01 merged 1 commit into
mainfrom
feat/sonar-rating-gate

Conversation

@ghost

@ghost ghost commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Adds sonar-rating-gate.yml — a reusable, org-level required-check that
gates 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.

PR base branch Rating (new code, worst-of-3) Duplication (new) Coverage (new)
after ≥ C ≤ 5% advisory (report, don't block)
next ≥ B ≤ 3% ≥ 80%
main A ≤ 3% ≥ 80%
before A ≤ 3% ≥ 80%

Independent of go-bash-ci.yml/mnab-gate.yml — reads SonarCloud API
measures, 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_coverage metric is treated as not-enforceable, not a failing
0%); 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.md documents the composite table, the consumption snippet, and
the required-check context (sonar-gate / rating-gate) that branch
protection / 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), same
gradient principle, deliberately not duplicating that work.

What this PR does NOT do (gated, handed to the operator separately)

  • Does not provision SONAR_TOKEN as an Actions secret — admin-plane,
    operator does this. Agents do not enumerate the secret store for it.
  • Does not apply branch protection / org ruleset required-check
    entries — exact gh api commands are handed to the operator alongside
    this PR (see the DECISIONS.md draft PR in .github-private).
  • Does not merge or self-approve.

Test plan

  • actionlint clean on sonar-rating-gate.yml (including embedded
    shellcheck via run: blocks) and on the full workflows directory.
  • Operator/priest smoke-test against a real centralstation PR once
    SONAR_TOKEN is provisioned (project key confirmed:
    alfred-intelligence_centralstation, org alfred-intelligence).
  • Wire required-check into branch protection per the handed-over
    gh api commands, then verify a sub-threshold PR is actually
    blocked.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sonarqubecloud

Copy link
Copy Markdown

@GeGGe01
GeGGe01 merged commit 08d9b59 into main Jul 16, 2026
5 checks passed
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.

2 participants