fix: bound every CI job with a timeout and stop masking install failures - #36
Merged
Conversation
josephfusco
force-pushed
the
fix/ci-job-timeouts
branch
from
August 20, 2026 14:41
865ba3a to
1252935
Compare
josephfusco
marked this pull request as draft
August 20, 2026 14:41
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
=========================================
Coverage 63.90% 63.90%
Complexity 35 35
=========================================
Files 7 7
Lines 266 266
=========================================
Hits 170 170
Misses 96 96
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The Playwright job was the only test job with `timeout-minutes`, so the recent stalled-mirror hang was capped at 30 minutes there but would have run to GitHub's 360-minute default anywhere else. phpunit is the sharper case: it clones Gutenberg trunk, runs npm install and builds wp-env's Docker images -- strictly more unbounded network work than Playwright -- and it's the job that actually failed on the last main run. Give each job a cap sized to a few times its observed runtime. Also drop Playwright's own cap from 30 to 15 minutes. Its browser install is separately bounded at 10 minutes worst case now, so the old number was ~5x a typical run and only delayed the report of a genuine hang. In build-gutenberg.sh, `npm install ... | grep ... || true` swallowed a failing npm alongside the grep it was meant to tolerate (grep exits 1 when it matches nothing), letting a broken install fall through to a confusing error from the build step instead. Check npm's own status via PIPESTATUS so only grep is allowed to fail.
josephfusco
force-pushed
the
fix/ci-job-timeouts
branch
from
August 20, 2026 14:59
1252935 to
38fff6a
Compare
josephfusco
marked this pull request as ready for review
August 20, 2026 15:01
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.
Follow-up to #34. That PR bounded the Playwright browser install after a stalled apt mirror ate a full 30-minute job; this covers the same class of failure everywhere else it can still happen.
Job timeouts
playwrightwas the only test job withtimeout-minutes. Every other job inherited GitHub's 360-minute default, so an equivalent hang outside Playwright would burn six hours before anyone noticed.phpunitis the sharpest case — it clones Gutenberg trunk, runsnpm install, and builds wp-env's Docker images, which is strictly more unbounded network work than Playwright does, and it's the job that actually failed on the lastmainrun.phpunit(both legs)codeqlplugin-checkphpcs/phpstangatePlaywright's own cap drops 30 → 15. Its install is separately bounded at 10 minutes worst case now, so 30 was ~5× a typical run and only delayed the report of a real hang.
Failure masking in
build-gutenberg.shnpm install --legacy-peer-deps 2>&1 | grep -E "…" || trueswallowed a failingnpmalong with thegrepit was meant to tolerate (grep exits 1 when it matches nothing). A broken Gutenberg install fell through to the build step and surfaced as a confusing downstream error rather than the real one. Now reads npm's own status out ofPIPESTATUSso only grep is allowed to fail.Test plan
actionlintclean on all workflowsshellcheckclean onbuild-gutenberg.shnpmon Ubuntu 24.04 / bash 5.2 — npm-ok, npm-ok-but-grep-matches-nothing, npm-fails, and exit-code propagation (7/7)Not included
Reproducibility is a real gap but a genuine tradeoff, so it's left for separate discussion:
build-gutenberg.shtracks moving Gutenberg trunk,.wp-env.jsonsets"core": null, andcomposer.jsonsets"lock": falsewith nocomposer.lock— upstream can turnmainred with no commit here, and a past run can't be reproduced as it was.Use of AI Tools
Assisting with the workflow audit, timeout sizing, and the build-gutenberg.sh fix.