Repository navigation
fix(ci): generate the SBOM before the blocking vulnix gate - #1343
Merged
Merged
Conversation
The nightly scan uploads its artifact with `if: always()` because a red gate is exactly when the findings are needed, but the image build and CycloneDX SBOM steps sat after the blocking gate unconditioned, so a red gate ended the job before they ran — the artifact was complete only on green runs. Assert the SBOM producers precede the gate, that nothing unconditional follows it, and (already true) that the gate stays blocking and the upload stays always(). RED: 2 failed, 2 passed. Refs: #1342
The CycloneDX SBOM and Trivy defence-in-depth steps carried no `if:` and sat after the blocking gate, so a red gate ended the job first and the artifact — uploaded with `if: always()` precisely because a red gate is when the evidence is needed — lost its SBOM on exactly those runs (17 kB on the red 2026-08-03 dev run vs ~466 kB on the green 2026-07-30 one). Move the SBOM steps above the gate rather than conditioning them, so the gate stays last, blocking and unconditioned: it remains the job's verdict and the tracking-issue automation keyed on `vulnix-gate.outcome` is untouched. Also relax the follow-the-gate assertion from `always()` to "states an explicit condition" — the tracking-issue step legitimately runs on `failure()`, and the invariant that matters is that no step after the gate is unconditioned. Refs: #1342
4 tasks
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.
Description
The nightly scan's SBOM steps ran after the blocking
vulnix-gatewith noif:condition, so a red gate ended the job before they executed. The artifact— uploaded with
if: always()precisely because "a red vulnix-gate is exactlywhen the findings are needed" — therefore carried its CycloneDX SBOM and Trivy
defence-in-depth view only on green runs, and was stripped on red ones.
Targets
release/1.6.0, notdev: the branch was cut minutes before thiswas filed and no RC has been tagged yet, so the fix rides 1.6.0 rather than
waiting a train.
devpicks it up via the release-merge PR.Closes #1342
Type of Change
fix-- Bug fixci-- CI/CD pipeline changesChanges Made
.github/workflows/security-scan.yml: the three evidence steps (Build the Nix image for SBOM generation,Generate Nix image SBOM (CycloneDX),Trivy SBOM-mode scan) move aboveGate on unexcepted HIGH/CRITICAL vulnix findings. The gate is now the last checking step; only thealways()uploadand summary and the
failure()-conditioned tracking-issue step follow it.The gate itself is byte-for-byte unchanged apart from a comment noting why it
is deliberately last.
tests/test_workflow_sbom_ordering.py(new): four YAML-shape assertions —the SBOM producers precede the gate; nothing after the gate is unconditioned;
the gate stays blocking (no
continue-on-error, noif:); the upload keepsalways().Ordering was chosen over
if: !cancelled()on the SBOM steps so the gateremains the job's final, unambiguous verdict. The cost is that the image build
now runs before the gate on every run — but
nix build .#devkitImageis largelycache-warm after
devkitImageEnvwas built earlier in the same job.Changelog Entry
Added to the frozen
## [1.6.0] - TBDsection (this ships in 1.6.0, so it doesnot belong under
## Unreleased):Testing
just test)Manual Testing Details
TDD, red-first. The test committed first (
ace02b53) against the unmodifiedworkflow:
The two that passed are the guards that already held (gate blocking, upload
always()) — they are regression cover, not new behavior.Re-verified after the fix by stashing only the workflow change, so the final
test file is proven red against the original workflow and green against the
fixed one:
Regression cover:
pytest -k workflow→ 130 passed, 529 deselected.Hooks:
just precommit(full suite, all files) green, exit 0, treeunmodified by the run.
Correction made mid-implementation
The first version of
test_nothing_unconditioned_follows_the_gateasserted thatevery step after the gate carries
always(). That was over-specified and failedagainst the correct workflow:
Open a tracking issue when the vulnix gate failsdeliberately runs on
failure() && steps.vulnix-gate.outcome == 'failure'. Theassertion now requires an explicit
if:on anything following the gate, whichis the invariant that actually prevents #1342 — an unconditioned step silently
inherits the gate's outcome.
Checklist
CHANGELOG.md(and pasted the entry above)Additional Notes
Not a regression from anything in 1.6.0 — the ordering has been there since the
SBOM steps were added, and it only bites on a red gate, which was rare until the
libssh2 batch turned the nightly red on 2026-07-31 (#1322 / #1323).
The fix cannot be proven end-to-end without a genuinely red gate, which
devno longer has after #1327 and #1328. The YAML-shape tests are the durable proof;
the next real red-gate run is the live confirmation.
Refs: #1342