Repository navigation
test(ci-supply-chain): guard that every CI job bounds its runtime with timeout-minutes - #744
Closed
hivecommons-hive[bot] wants to merge 1 commit into
Closed
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
No job in .github/workflows/ declares timeout-minutes, so all eleven inherit GitHub's 6-hour default. The commands these workflows run are network-bound -- markdown-link-check walks every link in every root Markdown file, and the scheduled jobs call the GitHub API -- so an unreachable host makes a step hang rather than fail and the job holds a runner for six hours. Only deploy-gh-pages declares a concurrency group, so the next run does not supersede a stuck one either. Add three contracts to tests/ci-supply-chain.test.mjs, alongside the existing action-pinning, permissions and persist-credentials contracts: - every boundable job declares timeout-minutes, with the eleven current gaps recorded in KNOWN_UNBOUNDED_JOBS - every declared value is a positive whole number below 360, checked through timeoutProblem(), which is exercised directly against usable values, quoted scalars, fractions, zero, negatives and 360+ - the baseline retires itself, failing the moment a listed job gains a timeout without its entry being removed KNOWN_UNBOUNDED_JOBS is a retiring baseline, not an allowance: the suite is green today and turns red the moment a job is bounded, which couples the fix to emptying the list. Jobs that delegate to a reusable workflow are excluded, since timeout-minutes is not accepted there. Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
Member
|
Superseded by #750, which consolidates this and 14 other test-only coverage PRs into a single reviewable change (commit cherry-picked unmodified, authorship and DCO preserved). |
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.
Test Improvement
Adds a
timeout-minutescontract totests/ci-supply-chain.test.mjs, alongside the action-pinning,permissionsandpersist-credentialscontracts already in that file. No other file is touched.No job in
.github/workflows/declarestimeout-minutes, so all eleven inherit GitHub's 6-hour default:That matters because the work these jobs do is network-bound.
ci.yml'svalidatejob runsnpm run check, which includescheck:links—markdown-link-checkagainst every link in every root Markdown file — plusnpx-resolvedcheck:spellingandcheck:markdown. A black-holed host makes those commands hang rather than fail, and the job then holds a runner for six hours on every affected pull request. The scheduled workflows call the GitHub API and would stall the same way. Onlydeploy-gh-pages.ymldeclares aconcurrencygroup, so a stuck run in the other seven is not superseded by the next one.What the three tests assert
every workflow job bounds its runtime with timeout-minutes— every job that can take a timeout declares one. Jobs that delegate to a reusable workflow viauses:are excluded, becausetimeout-minutesis not accepted on those.every declared timeout-minutes is a positive number below the 6-hour default— values are checked through a newtimeoutProblem()helper, which rejects non-numbers (a quoted YAML scalar parses as a string), non-integers and non-positives (a fraction is silently floored by the runner), and anything at or above 360 (which restates the default the setting exists to replace). A companion unit test exercisestimeoutProblem()directly against usable values, quoted scalars, fractions, zero, negatives and 360+, so the rule is tested rather than merely applied to whatever the workflows happen to contain today.the timeout-minutes baseline retires itself— fails as soon as a baselined job gains a timeout, or names a workflow or job that no longer exists.Why the suite is green today
KNOWN_UNBOUNDED_JOBSrecords the eleven currently unbounded jobs. It is a retiring baseline, not an allowance — the same shape as the existingKNOWN_PERSISTING_CHECKOUTSattests/ci-supply-chain.test.mjs:186-215. Bounding a job turns the suite red until its entry is removed in the same change, so the fix cannot land while quietly leaving the exception behind, and a bounded job cannot later regress unnoticed.Both failure directions were verified locally: adding
timeout-minutes: 30toci.yml'svalidatejob fails the retirement test withci.yml: validate now declares timeout-minutes; remove it from KNOWN_UNBOUNDED_JOBS so the gap cannot reopen, and droppingci.yml: lintfrom the baseline fails the main test.Verification
node --test tests/ci-supply-chain.test.mjs— 13 pass, 0 failnode tests/tools/coverage-report.mjs --check 97 --check-source 99— passes;src filesstays at 100.00 lines / 97.95 regions,all files99.08 / 93.35, and this file rises from 89.24 to 91.23 line coveragenpx prettier --check tests/ci-supply-chain.test.mjs— cleanRelated Issue
Refs #743 (needs-human: this PR adds only the guard; the fix itself edits
.github/workflows/**, which the App token used for automated pull requests cannot push — a push carrying that diff is rejected server-side because the token is minted without the Workflows permission. A maintainer, or an agent whose token carries theworkflowsscope, has to apply the YAML and emptyKNOWN_UNBOUNDED_JOBS. Issue #743 carries the exact replacement text for all ten job blocks and stays open until then.)Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88