fix(gates): SonarCloud is an external app check, not a governance advisory job - #757
Merged
hyperpolymath merged 2 commits intoSep 9, 2026
Merged
Conversation
Removes "SonarCloud Code Analysis" from never_required_contexts. never_required_contexts exists to keep governance-reusable's OWN advisory jobs (the continue-on-error ones) out of ruleset derivation -- that is what tests/test_governance_reusable_shape.sh check 6 asserts, and it names exactly three: "Live Actions policy (credentialed advisory)", "Code quality + docs", "Allowlist Preflight". All three are untouched here. SonarCloud Code Analysis is not one of those. It is emitted by the sonarqubecloud GitHub App, not by any job in this repo, so it was miscategorised. scripts/check-gate-tiers.sh already encodes the correct treatment for this class under EXTERNAL_REQUIRED: "required context emitted by a GitHub App rather than a workflow in this repo (CodeQL default setup, SonarCloud, ...). Printed for visibility, NOT counted: it is outside the tier system, not a breach of it." Measured contradiction: 76 repos require SonarCloud Code Analysis, and it is emitted and green on them. Because never_required_match subtracts an entry from the derived set, this line was preventing the derivation from ever reproducing production. Owner ruling: fix the one policy file rather than edit 76 rulesets to match it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCKh98NmUmfvgpuGyJbNu8
Contributor
|
Warning Review limit reachedNext included review available in 56 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
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 |
hyperpolymath
deleted the
fix/gates-sonarcloud-is-not-a-never-required-context
branch
September 9, 2026 16:14
|
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.



What
One entry removed from
never_required_contextsinconfig/rulesets/gates.json.Why: the list was being used for two different jobs
never_required_matchin this same file defines the semantics as a subtraction from the derived set:And
tests/test_governance_reusable_shape.shstates the list's actual purpose (check 6):It then asserts exactly three names —
Live Actions policy (credentialed advisory),Code quality + docs,Allowlist Preflight. Those aregovernance-reusable's owncontinue-on-error: truejobs. All three are untouched by this PR and the guard test still passes.SonarCloud Code Analysisis not one of them. It is emitted by thesonarqubecloudGitHub App, not by any job in this repository. It has nocontinue-on-errorto exempt and no job name to subtract. It was in an advisory-job exclusion list because it looked like a context to exclude, not because it is an advisory job.This repo's own tooling already says so
scripts/check-gate-tiers.shclassifies exactly this case, and reaches the opposite conclusion to the gates.json line:So the tier lint and the derivation policy disagreed with each other about the same class of context. This PR makes the policy agree with the lint.
The measured contradiction
76 repos require
SonarCloud Code Analysis. On those repos the context is emitted and green — it is a working gate doing real work. Becausenever_required_matchsubtracts, the policy line meant the derivation could never reproduce production: it would have stripped a live, passing, deliberately-required gate from all 76.Two ways to resolve that. Either edit 76 rulesets to match the policy, or edit one policy file to match the 76 rulesets. Owner ruling: fix the policy. When live configuration and written policy disagree at a scale of 76 repos, the policy is the thing more likely to be wrong — and here nothing is failing, so there is no defect to preserve.
⚠ Still open:
Code quality + docsresolves the OTHER wayNot fixed here, and deliberately so. 45 repo/context pairs require
Code quality + docs, which is one of the three genuine advisory jobs —continue-on-error: true, and the guard test requires its presence in this list. Removing it would breaktest_governance_reusable_shape.shand would promote a job that is allowed to fail into a blocking gate.So this is the same shape of contradiction with the opposite cure: for SonarCloud the policy was wrong; for
Code quality + docsthe 45 rulesets are wrong. That is a ruleset campaign, not a one-line change, and it needs its own decision. Flagged rather than folded in, so the ruling given for SonarCloud is not silently generalised to a case it does not fit.Verification
jq empty— valid JSON.tests/test_governance_reusable_shape.shverified still present.mainat8f2ee508and committed via the API, so no local working tree is involved.🤖 Generated with Claude Code
https://claude.ai/code/session_01TCKh98NmUmfvgpuGyJbNu8