Skip to content

fix(security-scan): file a tracking issue for pre-gate failures too - #1550

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1548-report-pre-gate-scan-failures
Aug 20, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1548-report-pre-gate-scan-failures

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

The nightly scan's tracking-issue step was guarded on the gate step's
outcome:

if: ${{ failure() && steps.vulnix-gate.outcome == 'failure' }}

steps.vulnix-gate.outcome is empty whenever a step before the gate fails, so
the guard was false and the run died silently — a red run in Actions and nothing
else, on a workflow whose scheduled runs have no other signal. That is the
exact hole #965 restored the issue to close.

It fired for real on 2026-08-20: an expired .vulnixignore block failed the
job's first step on both lanes
(run 32335643087),
and the failure surfaced only because someone went looking at the workflow list
(#1547).

Refs: #1548

Type of Change

  • fix -- Bug fix

Modifiers

  • Breaking change (!)

Changes Made

  • Guard is failure() alone — the whole job is now in scope: register
    validation, NVD cache, closure build, the vulnix run, SBOM generation
  • Two failure classes, two dedup titles, so neither can suppress the other's
    issue and each still dedups per ref (Scheduled security scan covers main only — add a dev-ref vulnix scan lane #1237):
    • gate → Nightly security scan (<ref>): unexcepted HIGH/CRITICAL vulnix findings
      — unchanged, so issues already open under it keep matching
    • pre-gate → Nightly security scan (<ref>): run failed before the vulnix gate,
      whose body states plainly that the closure went unscanned, not clean, and
      points at an expired register as the most likely cause
  • The pre-gate body names the failing step, read off the run's own job
    records — the same lookup the devkit-upgrade reporter uses ([FEATURE] devkit-upgrade: report a failed upgrade as a tracking issue (no artifact today) #1530), scoped to
    this matrix leg by job-name suffix so the dev lane never reports main's failing
    step. That needs the new actions: read grant on the job
  • Workflow header On failure: block and docs/CONTAINER_SECURITY.md §2 updated
    to describe both classes

Deliberately not in scope: auto-closing the tracking issue on a later green
run. Today's issue is closed by hand in both classes; changing that is a separate
behavior change, not this hole.

Changelog Entry

### Fixed

- **A nightly security scan that fails before the gate now files a tracking
  issue too** ([#1548](https://github.com/vig-os/devkit/issues/1548))
  - The issue-opening step was guarded on `steps.vulnix-gate.outcome ==
    'failure'` — an outcome that is *empty* whenever an earlier step fails. An
    expired `.vulnixignore` register, a failed closure build or a vulnix crash
    therefore produced a red run and nothing else, on a workflow whose whole
    point is that a scheduled run has no other signal
  - It fired for real on 2026-08-20: an expired block failed the job's first
    step on both lanes and surfaced nowhere
    ([#1547](https://github.com/vig-os/devkit/issues/1547))
  - The guard is now `failure()` alone, and the two failure classes carry
    distinct titles that dedup independently per ref: a red gate keeps its
    existing title, while a pre-gate failure files *run failed before the vulnix
    gate* and names the failing step, read off the run's own job records
    (`actions: read`). A pre-gate failure means the closure went **unscanned**,
    not clean — the body says so

Testing

  • Tests pass locally (just test)
  • Manual testing performed (below)

TDD: tests/test_workflow_scan_failure_reporting.py was committed red
(3 failures) before the fix, and passes after.

Manual Testing Details

YAML shape is not enough for a step that is only ever exercised on a red nightly
run, so the run: block was extracted and executed against a gh stub:

Case Result
GATE_OUTCOME=failure files the existing gate title + body verbatim
GATE_OUTCOME='' (pre-gate) files the new title; Failing step: Validate .vulnixignore exception expirations — correctly the dev leg's step, while the stub payload also carried a different failing step on the main leg
existing open issue Open tracking issue already exists: #4242 -- skipping create, exit 0, no create call

actionlint (which runs shellcheck over run: blocks) is clean, and the full
hook suite is green locally.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (docs/CONTAINER_SECURITY.md)
  • I have updated CHANGELOG.md in the [Unreleased] section (pasted above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

c-vigo added 2 commits August 20, 2026 09:06
The tracking-issue step is guarded on `steps.vulnix-gate.outcome ==
'failure'`, so a failure anywhere BEFORE the gate leaves that outcome
empty, the guard false, and the run silent -- a red run in Actions and
nothing else. An expired .vulnixignore block did exactly that on both
lanes on 2026-08-20 (run 32335643087), failing the job's FIRST step.

Three workflow-shape assertions, all failing today: the guard is
failure() with no gate-outcome conjunct; the script branches on the gate
outcome and carries a distinct dedup title per failure class; and the
pre-gate body names the failing step from the run's own job records,
which needs the actions: read grant.

Refs: #1548
The issue-opening step was guarded on `steps.vulnix-gate.outcome ==
'failure'`, which is empty whenever a step BEFORE the gate fails. Every
failure upstream of the gate -- expired .vulnixignore register, closure
build, the vulnix run itself -- therefore died as a red run with no
issue, on a workflow whose scheduled runs have no other signal. That is
the exact hole #965 restored the issue to close.

The guard is now failure() alone. The script branches on the gate
outcome and files under one of two titles, so the classes dedup
independently per ref (#1237): a red gate keeps its existing title (the
open issues filed under it still match), while a pre-gate failure files
"run failed before the vulnix gate" and says plainly that the closure
went UNSCANNED, not clean. Its body names the failing step from the
run's own job records -- the devkit-upgrade reporter's lookup (#1530),
scoped to this matrix leg by job-name suffix so the dev lane never
reports main's failing step -- which is what the new actions: read grant
buys.

Verified beyond YAML shape: the run block was extracted and executed
against a gh stub for both classes and for the dedup short-circuit. The
gate case reproduces the current title and body; the pre-gate case names
the dev leg's failing step while main's failure is in the same payload;
an existing open issue short-circuits before create.

Refs: #1548
@c-vigo c-vigo added this to the 1.11.0 milestone Aug 20, 2026
@c-vigo
c-vigo merged commit fe593bb into dev Aug 20, 2026
12 checks passed
@c-vigo
c-vigo deleted the bugfix/1548-report-pre-gate-scan-failures branch August 20, 2026 07:22
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.

1 participant