fix(ci): make the code-scanning SARIF upload best-effort (regression from #47) - #49
Conversation
Correcting the SARIF filename in #47 made this step reachable for the first time -- and it immediately failed the Security job on lexora with "Resource not accessible by integration". Code scanning ingest requires GitHub Advanced Security on private repositories, and most of the fleet is private. That is a regression introduced by #47: while the step was looking for a filename nox never writes, hashFiles() never matched, so the missing permission could not surface. Fixing the lookup exposed it. continue-on-error, because this upload is reporting, not enforcement. The gate step below is what decides pass/fail, and it is unaffected -- on the same lexora run it evaluated correctly and reported "net-new critical/ high: 0 (baselined findings: 57)". A repo without Advanced Security should still get its security gate; it just does not also get the findings mirrored into the code-scanning UI. Same rationale already applied to the taint-plugin install in this file. Claude-Session: https://claude.ai/code/session_01LMVPJFeTCEtUk2CSNBBBdK
|
Amending the diagnosis in the description above — the fix is right, but I attributed it to a single cause and there are two. I wrote that the upload fails because code-scanning ingest needs Advanced Security on private repos. That is true for lexora (private). But
So Blast radius of the #47 window, checked across all 28 fleet repos: exactly two runs affected (lexora, briefkasten). Reachability is enabled on no repo's default branch — only briefkasten's PR branch — so #366 is contained. |
…dable (#50) #49 added `continue-on-error: true` to js-ci's SARIF upload step, which already had one. GitHub rejects the whole file: klarlabs-studio/.github/.github/workflows/js-ci.yml@main : (Line: 176, Col: 9): 'continue-on-error' is already defined Every repo calling js-ci.yml has been failing at workflow load since #49 merged -- no jobs start, no logs are produced, and the run reports a bare "failure" with nothing to inspect. Surfaced on pet-medical-www#24. js-ci already carried this fix, with a comment saying the same thing; only go-ci was missing it. #49 should have touched go-ci alone. The guard that let this through was mine and too narrow: it searched only the first 400 characters after the step name for an existing continue-on-error, and js-ci's is behind a longer comment block. Worse, the YAML validation could not catch it either -- PyYAML accepts duplicate mapping keys silently, last one wins. Validation now uses a loader that rejects duplicates, which is what GitHub does. Claude-Session: https://claude.ai/code/session_01LMVPJFeTCEtUk2CSNBBBdK
This fixes a regression I introduced in #47. Merging it promptly matters — it can fail the Security job on every private repo in the fleet.
What happened
#47 corrected the SARIF lookup from
findings.sarif(a filename nox never writes) toresults.sarif. That was right, but it made the upload step reachable for the first time — and it immediately failed on lexora:Code-scanning ingest requires GitHub Advanced Security on private repositories. Most of the fleet is private (lexora, nexa, armada, episteme-api, vorhut, brotwerk, …). While the step was looking for a filename that never existed,
hashFiles()never matched, so the missing permission could never surface. Fixing the lookup exposed a latent problem.This is the same trap as the original bug, one layer down: a step that silently skipped was concealing something, and the concealment was mistaken for health.
The fix
continue-on-error: true, because this upload is reporting, not enforcement.The gate step is what decides pass/fail, and it is unaffected. On the very same lexora run it worked correctly:
That is the gate executing properly for the first time in that repo — matching my local scan exactly. A repo without Advanced Security should still get its security gate; it just does not also get findings mirrored into the code-scanning UI.
The file already applies this reasoning to the taint-plugin install, for the same reason:
Scope
Both
go-ci.ymlandjs-ci.yml. Public repos (warden, mnemos, bolt, keyward) are unaffected either way — their uploads succeed, and warden'smainis green post-#47.