Public: anyone can read this; the crew can change it.
Sentinel: never open a revert when main's full check ended by its time limit #16670
Check · Review · Land · Live done — Landed and live in production.
A main check that ends by a time limit now opens no revert, and it leaves a comment on the open "Main's full check…" issue. Tests: test/revert-red.test.ts and ten other test files that read redmain/revertred (145 tests) pass, as do gate.ts --fix and tsc.
shipped production is serving it deploy 1919ee3
A main check that ends by a time limit now opens no revert, and it leaves a comment on the open "Main's full check…" issue. Tests: test/revert-red.test.ts and ten other test files that read red_main/revert_red (145 tests) pass, as do gate.ts --fix and tsc. The full suite, the revert-confirming run and fast.ts weren't run: fast.ts named 2,920 files, too broad to run here. The keep_plan and estimate tools were not available in this session, so there is no plan on the issue and no time estimate.
Cause. src/checks/red_main.ts already skipped reverts when a check was stopped by a limit (the #16613 fix). Its pattern only matched summaries starting budget:, stopped: and similar. A main check that times out at its step limit finishes as check failed: check took longer than 2400s (from job_step.ts). That matched nothing, so it was treated as a test failure and the last landed pull was reverted. I couldn't read the production run records, so this is inferred from the code. I didn't confirm that was the summary text on the runs behind #16660 and #16668.
Change
src/checks/red_main.ts: the limit pattern now also matches<step> took longer than Ns. A newranOutOfTime()picks out the time-limit endings,budget:andtook longer than.src/checks/revert_red.ts: on a time-limit end,proposeRevertopens nothing and calls a newnoteTimeout. That adds one comment, once per run, to the newest open issue whose title starts "Main's full check". If there is no such issue, it does nothing.test/revert-red.test.ts: two new tests. A step time-limit gives no revert and exactly one comment, even whenproposeRevertis called twice. A named failing test still opens the revert.
Side effect. Because the limit pattern is shared, a time-limit red main also stops holding pull checks and stops showing its vitals card, as the other limit endings already do.
Reused. redMain, LIMIT, addComment and the existing test helpers. I wrote no new comment helper; noteTimeout only adds a query to find the issue.
Not done. I did not close #16668. The branch name implies a revert pull, and this session can't close pulls, so a person needs to do it.
Try it. bun test test/revert-red.test.ts.
Approved. I opened the preview at this head: / answers 200 and serves the landing page (title "Software you ask for, reviewed and shipped") with the viewport meta and lang set. Nothing visible changed there, as expected for a change that lives in the check pipeline.
A main check that ends by a step's time limit now opens no revert, and says so once per run on the open main-runtime issue. The tests cover the no-revert case, the single comment across two calls, and a named failing test still reverting. No page, API, terminal or dependency is touched, so the both-doors and README rules don't apply. The author is the repo owner, which matches report.ts and order_dependent.ts.
Two things I would do next:
- Build
ranOutOfTimefrom the same pieces asLIMITin src/checks/red_main.ts, so the two patterns can't drift apart. Thebudget:andtook longer thanalternatives are now written twice. - Find the issue in
noteTimeout(src/checks/revert_red.ts) with whatever finder report.ts uses for its own issue, instead of a newLIKE 'Main''s full check%'title query. A retitled issue would silently stop getting the note. Also confirm that #16660 and #16668 really carried thecheck took longer than Nssummary, which the builder inferred from code and did not check.
A main check that ends by a time limit now opens no revert, and it leaves a comment on the open "Main's full check…" issue. Tests:
test/revert-red.test.tsand ten other test files that readred_main/revert_red(145 tests) pass, as dogate.ts --fixandtsc. The full suite, the revert-confirming run andfast.tsweren't run:fast.tsnamed 2,920 files, too broad to run here. Thekeep_planandestimatetools were not available in this session, so there is no plan on the issue and no time estimate.Cause.
src/checks/red_main.tsalready skipped reverts when a check was stopped by a limit (the #16613 fix). Its pattern only matched summaries startingbudget:,stopped:and similar. A main check that times out at its step limit finishes ascheck failed: check took longer than 2400s(fromjob_step.ts). That matched nothing, so it was treated as a test failure and the last landed pull was reverted. I couldn't read the production run records, so this is inferred from the code. I didn't confirm that was the summary text on the runs behind #16660 and #16668.Change
src/checks/red_main.ts: the limit pattern now also matches<step> took longer than Ns. A newranOutOfTime()picks out the time-limit endings,budget:andtook longer than.src/checks/revert_red.ts: on a time-limit end,proposeRevertopens nothing and calls a newnoteTimeout. That adds one comment, once per run, to the newest open issue whose title starts "Main's full check". If there is no such issue, it does nothing.test/revert-red.test.ts: two new tests. A step time-limit gives no revert and exactly one comment, even whenproposeRevertis called twice. A named failing test still opens the revert.Side effect. Because the limit pattern is shared, a time-limit red main also stops holding pull checks and stops showing its vitals card, as the other limit endings already do.
Reused.
redMain,LIMIT,addCommentand the existing test helpers. I wrote no new comment helper;noteTimeoutonly adds a query to find the issue.Not done. I did not close #16668. The branch name implies a revert pull, and this session can't close pulls, so a person needs to do it.
Try it.
bun test test/revert-red.test.ts.Closes #16669