Repository navigation
ci(timeouts): set timeout-minutes on every job - #1427
Conversation
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Without timeout-minutes, GitHub stops a job after 360 minutes. A job that hangs holds its runner, and costs money, for all of that time. In a recent runner trial, one job without a limit ran for over 2 hours. Each new value is about twice the longest successful run of the job in the 30 days to 28 October 2026, rounded up to a multiple of 5 minutes, with a floor of 10 minutes. Jobs that already had a limit keep it. The release job is the one exception. Its npm wait step has its own 20-minute limit, so the measured 10 minutes could stop the job before that step does, in the middle of a publish. It gets 30 minutes.
Every job now sets a limit. This keeps it that way: a new job without timeout-minutes fails `pnpm run test:scripts`. A job that calls a reusable workflow cannot set the key. A call to a workflow in this repository is covered through the called workflow's own jobs. A call to another repository's workflow needs a written reason, and a reason for a call that no longer exists fails too.
e92c830 to
960081c
Compare
Task 1 merges main into the #1427 branch. Step 5 pushed nothing when the test passed. After a conflict, though, the resolved merge commit exists only locally, and the pull request still shows the conflict. Step 5 now pushes in that case.
The plan named two commits by hashes that are on no branch now. - Commit b283c22 was #1419's apt-get update fix before #1419 was rebased. - Commit c1985b4 was #1427's timeout commit before #1427 was rebased. In a new clone, git show fails on both hashes. A rebase changes a commit's hash. It keeps the commit's subject. So the plan now names each commit by its pull request and its subject.
On Blacksmith the job takes 14 to 15 minutes. Its limit is 15 minutes. So it is often cancelled, on main and on #1416. The migration harness self-test alone takes about 11 minutes. #1427 sets each limit at about twice the job's longest successful run in 30 days. It rounds up to a multiple of 5 minutes. From 26 October to 25 November 2026, the longest successful run took 22 minutes 31 seconds. That was run 43117752256. Twice that is 45 minutes, so the limit is 50.
Task 1 merges main into the #1427 branch. Step 5 pushed nothing when the test passed. After a conflict, though, the resolved merge commit exists only locally, and the pull request still shows the conflict. Step 5 now pushes in that case.
The plan named two commits by hashes that are on no branch now. - Commit b283c22 was #1419's apt-get update fix before #1419 was rebased. - Commit c1985b4 was #1427's timeout commit before #1427 was rebased. In a new clone, git show fails on both hashes. A rebase changes a commit's hash. It keeps the commit's subject. So the plan now names each commit by its pull request and its subject.
Summary
Every job in this repository now has
timeout-minutes, and a new test keeps it that way. Without the key, GitHub stops a job after 360 minutes. A job that hangs holds its runner, and costs money, for all of that time. In a recent runner trial, one job without a limit ran for over 2 hours. This is one step towards keeping CI spending under $1,000 a month (ADR 0002 in #1416).Changes
timeout-minutes. No other line changes. The line sits straight afterruns-on:, as in the jobs that already had a limit. Jobs that had a limit keep it, including Mutants at 120 minutes.scripts/__tests__/workflow-job-timeouts.test.mjsfails when a job withruns-onhas notimeout-minutes, or has zero. A job that calls a reusable workflow cannot set the key. A call to a workflow in this repository is covered through the called workflow's own jobs. A call to another repository's workflow needs a written reason. Today that is onlyosv-scanner.yml, which calls Google's OSV-Scanner workflow. A reason for a call that no longer exists fails the test.codeql.ymlanalyzefta-v3.ymlftaintegration-drizzle.ymlintegrationintegration-prisma-next.ymlintegrationintegration-supabase.ymlintegrationprisma-example-readme-e2e.ymlwalkthroughprisma-next-e2e.ymle2erelease.ymlreleasetest-eql.ymlbuild-archivetest-eql.ymlchangestest-eql.ymlci-requiredtest-eql.ymlcodegentest-eql.ymldoc-anchorstest-eql.ymldocs-statictest-eql.ymle2etest-eql.ymlknown-failurestest-eql.ymlmatrix-coveragetest-eql.ymlrust-cratestest-eql.ymlschematest-eql.ymlself-contained-v3test-eql.ymlsetuptest-eql.ymlsplintertest-eql.ymltesttest-eql.ymlvalidatetests-bench.ymltests-benchtests-supply-chain.ymlverify-no-caching-in-release-workflowstests.ymle2e-teststests.ymllinttests.ymlrun-teststests.ymlrun-tests-buntests.ymlwasm-e2e-tests"Successful runs read" counts the job's successful runs among the runs the script read. "(capped)" is explained under Review notes.
Verification
test-eql.ymlrun returned HTTP 502 for its job list every time, so it was skipped.pnpm run test:scripts: 81 files passed, 1424 tests passed, 3 skipped. Before the workflow changes, the new test failed and listed the 31 jobs.${{ fromJSON('10') }}.pnpm exec biome checkon the new test: no findings..github/actionlint.yaml, on every workflow before and after: the same 5 findings both times. All are shellcheck notes that were there before.Related
timeout-minutes).Review notes
timeout-minutes: 20and waits up to 900 seconds by design (scripts/wait-for-npm-versions.mjs). A 10-minute job limit could stop the job before that step's own limit, in the middle of a publish. 30 covers the 20-minute step plus 10 minutes for the rest of the job, which took at most 3 minutes.test-eql.yml,tests.ymlandintegration-drizzle.ymlhave hundreds of runs over 5 minutes. For each, I read the 100 longest runs of the 30 days. A longer run of a job could hide in the runs I did not read. The longest unread run oftest-eql.ymltook 20.7 minutes in total, and oftests.yml8.9 minutes. That sets an upper bound for a job inside them. A job is marked "(capped)" when that bound could give it a larger limit.test-eql.yml'sbuild-archive(21.2 minutes) ande2e(19.3 minutes), andintegration-drizzle.yml(15.4 minutes). A job that moves to a slower runner may still need a higher limit.runs-on:or add jobs to the same workflows will conflict on the line next toruns-on:. Keep both lines. A job added by another pull request also needs its owntimeout-minutes, or the new test fails once both have merged.Summary by CodeRabbit
Chores
Tests