Repository navigation
fix(ci): give the guard's long steps their own timeouts and declare gate refusals - #1721
Merged
Merged
Conversation
Three failing shape tests for the release-neutral guard's timeout hole. A job `timeout-minutes` expiry cancels the job, so the step that hung reports `cancelled` and gate 6 — which runs under `!cancelled()` — is skipped, leaving the last positive verdict standing over a run that proved nothing. The tests pin the fix: the three long steps (`setup`, `gate2`, `vulnix`) carry their own integer budgets whose sum stays strictly below the job's, so a hang fails the STEP and the job lives on; gate 6's scan selects the first outcome that is neither `success` nor `skipped` rather than matching the literal `failure`; and a `cancelled` outcome takes the infrastructure wording whichever step it was. Refs: #1712
The assertion sliced from the word `cancelled`, which sits AFTER the `$outcome` the same line reads, so the recorded-outcome check could never match a correct implementation. Slice from the start of that line instead. Still red: gate 6 does not test the outcome at all yet. Refs: #1712
… verdict scan
A job `timeout-minutes` expiry CANCELS the job: the step that hung
reports `cancelled`, and gate 6 runs under `!cancelled()`, so a run that
timed out skipped the verdict entirely and left the last positive one
standing over a run that proved nothing. A label-event run cannot even be
superseded, so nothing else was going to rewrite it.
Closed from the step side. `setup` (10), `gate2` (10) and `vulnix` (60)
each carry their own budget, summing to 80 — under the job's 90 — so a
hang fails the STEP while the job lives on and gate 6 still runs. Measured
on the one `.vulnixignore` lane run to date, those steps take 41 s, 32 s
and 129 s: hang detectors, not tight budgets. The cancellations left are a
manual cancel and a lost runner, for which skipping the verdict is
correct — neither reached a conclusion.
The outcome scan now selects the first entry that is neither `success` nor
`skipped`, rather than matching the literal `failure` which read a
`cancelled` step as green, and a `cancelled` outcome takes the
infrastructure wording ("timed out or was cancelled before completing")
whichever step it was — including gate 2, whose failure is the lane's
central refusal. The per-step wording is unchanged for real failures.
The step `if:` conditions are deliberately NOT widened: `!cancelled()`
stays as #1705 wrote it. Letting a cancelled run post would also let a
manually cancelled or runner-lost label run overwrite a real verdict with
a refusal it never reached.
Refs: #1712
One sentence beside the gate 6 paragraph in the release-cycle doc, and a `Fixed` changelog entry (mirrored into the scaffold copy by the `sync-manifest` hook): a job timeout is a cancellation, so the long steps carry their own budgets under the job's and the verdict scan reads any non-green outcome. Refs: #1712
…s one A step killed by its own `timeout-minutes` exits `failure`, not `cancelled`: the runner writes "The action '…' has timed out after N minutes." and fails the step, while `cancelled` belongs to the job-cancellation path — and a cancelled job never reaches gate 6 through `!cancelled()`. So a `failure` outcome covers both "gate 2 refused this change" and "gate 2 never finished", and the branch keyed on `cancelled` is near-unreachable while the per-step wording libels a change nothing examined. The tests pin the rule instead: each of the five gates writes `refused=true` to `$GITHUB_OUTPUT` where it states its refusal (the vulnix extra exactly once, in the `vulnix-gate` branch — its scan-failure exit is infrastructure), gate 6 reads those five declarations through a `REFUSED` env and nothing for the checkout or the set-up, and the per-gate refusal wording sits behind the declared flag so a failure without one — a timeout, a crash, an unknown outcome — is reported as infrastructure. Also replaces the now-vacuous ordering assertion in the #1705 test and corrects the scan test's docstring. Refs: #1712
A step killed by its own `timeout-minutes` exits `failure`, not `cancelled`: the runner writes "The action '…' has timed out after N minutes." and fails the step, while `cancelled` is the job-cancellation path — and a cancelled job never reaches gate 6 through `!cancelled()`. So the previous `cancelled` branch was near-unreachable, and a gate 2 or vulnix step whose budget expired fell into the per-step `case` and was reported as "This change is NOT release-neutral … gate 2 refused it": the false refusal that branch existed to prevent, and the mirror image of the defect #1705 fixed. An outcome cannot say WHY a step is non-green, so the gates say it themselves. Each of the five gates writes `refused=true` to `$GITHUB_OUTPUT` on the path where it states its refusal — the vulnix extra only in the `vulnix-gate` branch, since a scan that failed three attempts says nothing about the register — and gate 6 reads those five declarations through a new `REFUSED` env. The per-gate refusal wording is now reachable only with a declaration; every other non-green outcome (a failure without one, `cancelled`, an unrecognised or empty value) takes the infrastructure wording, naming the step and asking for a rerun. The checkout and the toolchain set-up keep their existing phrasing and are given no flag: they have nothing to refuse. Erring this way costs a rerun. Erring the other way tells a reviewer a gate refused a change it never examined. Refs: #1712
The changelog entry and the release-cycle sentence described the step budgets as turning a hang into a `cancelled` step. The runner reports a step that exhausts its own budget as `failure`, which is why gate 6 now reads a declared `refused=true` rather than inferring a refusal from the outcome. Both copies say that instead; the scaffold mirror is regenerated by the `sync-manifest` hook. Refs: #1712
Gates 3 and 5 wrote `refused=true` after listing the offending paths; under `pipefail` a hiccup in that listing would have turned a real refusal into an infrastructure failure. Declare first, then explain. Refs: #1712
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
#1705 made gate 6 of
release-neutral-guard.ymlrun on!cancelled()so a gate failure or an unlabel rewrites the sticky verdict. One residual of the same class stayed: the job'stimeout-minutes: 90expiry cancels the job, so gate 6 is skipped and the last positive verdict stands over a run that proved nothing. Worse, the in-flight step's outcome under a timeout iscancelled, notfailure— so even theif:widening the issue proposed would have fallen through to the green body, because the scan matched the literalfailure.Three changes, and one deliberate non-change:
setup10,gate210,vulnix60 minutes — summing to 80, under the job's 90 — so a hang fails the step while the job lives on to reach gate 6 under the untouched!cancelled(). Measured on the one.vulnixignorelane run so far (set-up 41 s, gate 2 32 s, the extra 129 s), these are hang detectors, not tight budgets; the 60 leaves room for a cold-NVD rebuild ofmain's closure.failure— indistinguishable from a gate refusing the change, so gate 6 would have called a gate 2 timeout "gate 2 refused it". A refusal is now something a gate declares: each of the five gates writesrefused=trueto$GITHUB_OUTPUTon the path where it states its refusal (the vulnix extra only in itsvulnix-gatebranch, never in the scan-failure branch), and gate 6 reads them through aREFUSEDenv. The per-gate refusal wording is used only when the flag is set; every other non-green outcome — a failure with no declaration, a cancellation, an unrecognised value — is worded as infrastructure ("failed or timed out … before reaching a verdict"), naming the step and asking for a rerun. Erring that way costs a rerun; erring the other way tells a reviewer a gate refused a change it never examined.successnorskipped(the two green outcomes are enumerated), so an unexpected outcome can no longer fall through to the positive verdict.if:is not widened. With step budgets in place the only cancels left are a manual cancel and a lost runner, and for those skipping gate 6 is correct: a label run cancelled by hand must not have its real verdict overwritten by a refusal it never reached. Declined explicitly so the issue's proposal does not read as half-done.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
.github/workflows/release-neutral-guard.ymltimeout-minuteson thesetup,gate2andvulnixsteps with a STEP BUDGETS comment; job budget unchangedrefused=trueto$GITHUB_OUTPUTon their refusal pathREFUSEDenv over the five gates; scancase "${entry#*=}" in success | skipped) continue ;; esac; refusal wording only behind"$refused" = true, else infrastructure; the# Residual (#1712)note from fix(ci): rewrite the guard verdict on gate failure or unlabel #1713 replaced by the resolutiontests/test_workflow_release_neutral.pytest_long_steps_carry_their_own_timeout(integer budgets on the three ids, sum strictly below the job budget — the load-bearing assertion),test_verdict_scan_treats_any_non_green_outcome_as_non_green,test_every_gate_declares_its_refusal,test_the_vulnix_extra_declares_only_its_own_refusal(exactly once, after thevulnix-gatecall),test_verdict_reads_every_gate_s_refusal_flag,test_verdict_words_an_undeclared_failure_as_infrastructure(andcancelledabsent from the verdict code); the pre-existingtest_gate_6_refuses_instead_of_repeating_the_positive_verdictnow pins the refusal wording behind the flag. All RED before their implementation commitsdocs/RELEASE_CYCLE.md,CHANGELOG.md,assets/workspace/.devcontainer/CHANGELOG.md### Fixedentry, mirror regenerated by thesync-manifesthookChangelog Entry
Fixed
standing (#1712)
timeout-minutesexpiry cancels the job, so gate 6 — which runson
!cancelled()— was skipped: a run that proved nothing left the previous"This change is release-neutral" comment as the pull request's only verdict,
and a label-event run cannot even be superseded, so nothing else would
rewrite it. The toolchain set-up, gate 2 and the
.vulnixignoreextra nowcarry their own step budgets (10, 10 and 60 minutes, summing to less than the
job's 90), so a hang expires a step's budget first and the job survives to
report it.
exhausted its own budget as
failure— indistinguishable from a gaterefusing the change, and gate 6 would have called it "gate 2 refused it".
A refusal is now something a gate declares: each of the five gates writes
refused=truewhere it states its refusal, and gate 6 words a refusal onlywhere one was declared. Every other non-green outcome — a failure with no
declaration, a cancellation, an unrecognised value — is reported as
infrastructure, naming the step and asking for a rerun. The outcome scan also
no longer selects on the literal
failure, so an unexpected outcome can nolonger fall through to the positive verdict.
Testing
just test)Manual Testing Details
ghfor eight cases:gate2=failurewith and without the flag (refusal vs "failed or timed out … before reaching a verdict"),vulnix=failurewith and without,gate1=failure+ flag,checkout=failure,gate2=cancelled, all-green (unchanged verdict + table + file list); all rc=0. The all-emptyREFUSEDstring the folded scalar produces was exercised tooactionlintclean;uv run pytest tests/test_workflow_release_neutral.py tests/test_workflow_zizmor_baseline.py -q→ 53 passed; adjacent changelog/docs suites → 90 passedprek run --all-files→ 55 hooks passedChecklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
ghrun and the shape tests are the evidence. The declaration relies on a failed step's$GITHUB_OUTPUTwrites still being exposed assteps.<id>.outputs(standard runner behaviour); the next lane PR that trips gate 1 or 3 confirms it live.timeout-minutesreportsfailure, notcancelled— the first version of this branch keyed the infrastructure wording oncancelledand would have mis-worded a gate 2 timeout as a refusal. The declared-refusal rule replaced it.setupstep is auses:of a local composite action. GitHub does not supporttimeout-minuteson steps inside a composite; at the caller level it applies to the whole step, which is what is set here. The two steps that could realistically hang (gate2,vulnix) are plainrun:steps.Refs: #1712