Repository navigation
ci(security-scan): let a CodeQL configuration error fail the job - #69
Merged
Merged
Conversation
The Analyze step carried `continue-on-error: true` with the comment "default-setup collision otherwise fails". It did exactly that -- and in doing so converted a rejected upload into a permanent green check.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
WomB0ComB0
marked this pull request as draft
September 30, 2026 14:18
WomB0ComB0
marked this pull request as ready for review
October 1, 2026 23:04
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
Removes
continue-on-error: truefrom theAnalyzestep of the reusablesecurity-scan.ymlCodeQL job, and replaces it with a comment recording why areal failure must now be allowed to fail the job.
- name: Analyze uses: github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 with: category: "/language:${{ matrix.language }}" - continue-on-error: true # default-setup collision otherwise failsWhy the flag was there, and why it can go now
The comment was accurate. On every repository where GitHub's CodeQL default
setup is enabled, the advanced-setup upload from this reusable is rejected:
Measured in a job log on an affected repository. Positive control, same grep on
a repository with default setup off:
The error is emitted by the
Analyzestep itself, in its main phase — not by apost-job step — which is precisely what
continue-on-error: trueon that stepswallows. Had it genuinely been post-job, a
continue-on-erroron the stepcould not have masked it, so "post-job" never explained the green check it was
offered to explain.
The ordering is established from step timings against the log, not from prose:
in an affected job the
##[error]line falls inside theAnalyzestep's ownspan (Jobs API
steps[].started_at/completed_at), ahead of the firstPost job cleanup.line. Only the trailingCodeQL job status was ...line ispost-job, printed by
init-post, and it is not the rejection — the positivecontrol prints the same line reading
CodeQL job status was success.The result was that a configuration error reported green, indefinitely, for
scanning that never landed.
This is not a coverage loss. Default setup runs the
extendedquery suite,which is broader than the
defaultsuite these advanced workflows use. Thediscarded work was also the weaker work. Removing the declaration removes waste
and a false signal; it does not reduce scanning.
Ordering — this must not merge first
Important
Do not merge before the consumer PRs below. Removing the flag while the
collision still exists would convert a silent failure into a hard failure on
every affected consumer at once.
Consumers that stop declaring advanced CodeQL, leaving default setup to own it:
Three of those repositories (
viz,vcpkg,dotnet-sdk) reach this reusableby a second path —
ci.yml->required.yml->security-scan.yml,passing
codeql-languages. Closing only thesecurity.ymlpath on those threewould leave the collision live, so these are gating too:
Every PR in both lists needs to land before this one.
The mitigating fact, stated rather than relied on
Every consumer pins this reusable by full commit SHA, and this repository has no
tags (
git ls-remote --tagsreturns nothing). A change tosecurity-scan.ymlon
maintherefore reaches no consumer until that consumer re-pins. Thatmakes the ordering more forgiving than it looks. It is not a reason to skip it:
the next routine pin bump on an unfixed consumer is what would collect the
hard failure, at a moment nobody is expecting it.
What else this flag was masking
The point of removing it is that a genuine CodeQL failure — an extraction
fault, autobuild breakage, a rejected SARIF — should stop the job. So the
question that matters is whether any consumer would newly fail for a reason
unrelated to the collision.
The repositories where removal actually bites are the ones with default setup
off, whose advanced runs are the real coverage. Checked by reading the
Analyzestep's own job log, because step conclusions cannot answer this —a
continue-on-errorstep reportsconclusion: successin the Jobs API evenwhen it failed, and an affected repository's
Analyzestep readssuccessthere while its log carries the configuration error.
crates["actions"]Analysis upload status is complete./CodeQL job status was success.— no##[error]programs["actions"]Analysis upload status is complete./CodeQL job status was success.— no##[error]Both are clean. The only diagnostics in either log are non-fatal deprecation
warnings (CodeQL Action v3 EOL, Node 20), which do not fail a step. Neither
repository newly fails.
One further consumer outside this PR series also has default setup off and real
advanced coverage; its
Analyzelogs were checked the same way and are equallyclean.
One consumer is not yet covered
One consumer outside this PR series has default setup enabled and still
declares
languages. Its latest run reproduces the collision on both matrixlanguages. It pins an older SHA of this reusable, so it is unaffected today,
but it needs the same treatment as the consumers listed above before it
re-pins. Flagging it here rather than fixing it in this PR, which is scoped
to the reusable.
Note also that
cratesandprogramsrun Rust CodeQL from a repo-localcodeql.yml, not through this reusable, so this change does not touch thatpath.
The same pattern elsewhere
continue-on-errorremains elsewhere in this same file. These uses each carrya comment explaining themselves, and are left alone:
vetstepSOFT-LAUNCH: warn-only until promoted to requiredUpload zizmor SARIFRun SnykUpload Snyk SARIFOne use has no such comment. It is worth a separate look and is not changed here:
Run zizmor(run: uvx zizmor --format sarif .github/workflows/ > zizmor.sarif)carries a bare
continue-on-error: truewith no comment. Because theredirect creates
zizmor.sarifwhether or not the tool succeeded, thehashFilesguard on the upload step still fires, and that upload is itselfcontinue-on-error— so a zizmor tool failure would pass silently end toend. It is not masking anything today (zizmor is uploading real findings on
the repos checked, and its step exits 0), but the failure mode is unguarded
and undocumented. Out of scope for this PR.
Pins
No
uses:line is modified. The one in the touched hunk was re-verified:github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fdresolves to
refs/tags/v4.38.1^{}viagit ls-remote --tags, matching its# v4.38.1comment.Conflicts
The only other open PR touching this file is #59 (Dependabot), which changes the
astral-sh/setup-uvpin in thezizmorjob, well away from this hunk. Nooverlap.
Test plan
codeqljob has nocontinue-on-erroron any step, and every other job is untouchedAnalysis upload status is complete.cratesandprogramsAnalyzelogs confirmed free of##[error]and reportingCodeQL job status was success.git ls-remote --tagssecurityrun stays green