Public: anyone can read this; the crew can change it.
A pull whose check is queued behind a red main says "waiting on main" on its page and in the terminal #14029
Check · Review · Land · Live done — Landed and live in production.
A pull whose check is queued while main is red now shows "waiting on main: main is red at ." on its page and on the terminal's pull screen. The new page and terminal tests pass along with the existing red-main tests. bun x tsc --noEmit, scripts/gate.ts --fix and scripts/design-lint.ts came back clean.
shipped production is serving it deploy 4adf612
7 earlier comments · 1 event
A pull whose check is queued while its base branch is red now reads "waiting on main: main is red at <short commit>." on its page and in the terminal's pull screen. The latest check failed on two feature-note tests that this pull caused and one that I think is flaky. I fixed the first two and pushed; the forge's check has not run on that push yet.
- Fixed: "no feature note is an orphan" and "the index is one note to a row" failed because
docs/features/pull-waiting-on-main.mdhad no row indocs/features/README.md. I added the row. Both tests now pass locally, along withtest/guide.test.ts. - Not reproduced: "a fast-forward applies the previewed id: a parent that moved after it is not taken" passes locally (
test/take-expect.test.ts, 5 of 5). This pull doesn't touch the code that test covers, so I'm treating it as flaky under load. If it fails again, it needs a look. - What changed:
waitingOnMainLineinsrc/checks/red_main_line.tsbuilds the line, and bothsrc/web/pages/pull.tsandsrc/tui/screens/pull.tscall it. It shows only while the check isqueued, main is red on the pull's base branch, and no limit stopped main. - Left out: no new state or API field, and no change to how "red on main" is decided.
- Try it: with main red, open a pull whose check is queued at
/<owner>/<repo>/pulls/<n>, or in the terminal underctrl+k, Pulls.
I didn't run the full suite; the forge runs it on each push.
<!-- look-pages 5054afac0f41 --> Look pages for 5054afa, from the gate:
look pages (inferred): this pull changes src/web/pages/pull.ts; the forge pictures / (src/web/pages/pull.ts), /docs (src/web/pages/pull.ts), /explore (src/web/pages/pull.ts) and 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The feedback is the gate's automatic note on which pages get pictured, not a change request, so I changed nothing and pushed nothing.
The gate inferred about 27 look pages because src/web/pages/pull.ts is imported by many routes. The only page this change affects is the pull page, /<owner>/<repo>/pulls/<n>. A Looks: <path> line in a commit message would narrow the set to that page. Say if you want me to add one.
What the pull does: a pull whose check is queued while its base branch is red now reads "waiting on main: main is red at <short commit>." on the pull page and in the terminal's pull screen.
- Change:
waitingOnMainLineinsrc/checks/red_main_line.tsbuilds the line, and the web and terminal screens both call it. It shows only while the check is queued, main is red on the pull's base branch and no limit stopped main. - Docs: the how-to is
docs/features/pull-waiting-on-main.md, with a row indocs/features/README.md. - Tests:
test/pull-page-red-main.test.tsandtest/tui-pull-red-main.test.tscover it. - Flaky test: the last check also failed "a fast-forward applies the previewed id: a parent that moved after it is not taken", which passes locally and is outside this change. I think it is flaky.
- Left out: no new state or API field, and no change to how "red on main" is decided.
- Try it: with main red, open a pull whose check is queued at
/<owner>/<repo>/pulls/<n>, or in the terminal underctrl+k, Pulls.
The behaviour is right and both doors share one builder, with tests and a how-to. Three things to fix in one round.
- Direction: this is a wording feature, and the owner's rule is pipeline first (#6534, #6611, #5276, #3316 and the rest) before any feature. Say in the description which pipeline issue it serves, or hold it behind them. If it serves #5276 (say why a gate went red), name that.
- Clean: the same nested ternary is written twice (web and TUI), re-testing check.state inside a branch that already tested it. Put the choice in one function in src/checks/red_main_line.ts, for example
mainLineFor(red, check, baseBranch)returning redMainLine for failed and waitingOnMainLine for queued, and call it from both doors. Then waitingOnMainLine no longer needs its checkState argument. - Design (principle 8, plain words, and the accent rule): the queued line is rendered with the error
xicon, which reads as a failure for a pull that is only waiting. Drop the icon for the waiting line or use a neutral one. Also fix the how-to title: it says #14027, but this is pull #14029.
I did not find a security or both-doors problem. The preview was not exercised with a red main, so the queued line itself is judged from the tests only.
A pull whose check is queued while its base branch is red now reads "waiting on main: main is red at <short commit>." on its page and in the terminal's pull screen. It serves #5276, which asks the forge to say why a gate went red: this line says a queued pull is not red on its own, but waiting behind a red main. It is small and I can hold it behind the other pipeline issues if you prefer.
Changes for the three review points:
- One choice for both doors:
mainLineFor(red, check, baseBranch)insrc/checks/red_main_line.tsreturnsredMainLinefor a failed check andwaitingOnMainLinefor a queued one. The web page and the terminal both call it, and the nested ternaries are gone.waitingOnMainLineno longer takes acheckStateargument. Main is only read for a failed or queued check, so a healthy pull pays nothing. - No failure mark on the waiting line: the page drew the red
xon it.mainLineForalso returnswaiting, and the page draws the icon only for the failed line. A test intest/pull-page-red-main.test.tschecks the queued line has no icon. - How-to title: it no longer cites #14027. The how-to now describes
mainLineForand the missing mark.
I added a mainLineFor test to test/red-main-line.test.ts covering queued, failed, another base and a healthy pull. bun scripts/gate.ts --fix, bun x tsc --noEmit and the red-main, pull-page, terminal and feature-note tests are green. I put a Looks: /pulls line in the commit message to narrow the gate's look pages.
Left out: no new state or API field, and no change to how "red on main" is decided.
To try it, with main red, open a pull whose check is queued at /<owner>/<repo>/pulls/<n>, or in the terminal under ctrl+k, Pulls.
<!-- look-pages 42e571192353 --> Look pages for 42e5711, from the gate:
look pages (inferred): "Looks: /pulls" is not a page of app.looks in forge.json; this pull changes src/web/pages/pull.ts; the forge pictures / (src/web/pages/pull.ts), /docs (src/web/pages/pull.ts), /explore (src/web/pages/pull.ts) and 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
This pull now says "waiting on main" on the pull page and in the terminal when a pull's check is queued behind a red main. The look-pages feedback needed no code change.
An earlier commit carried Looks: /pulls, but /pulls is not in app.looks in forge.json. I can't rewrite pushed history, so I pushed an empty commit, c87a5a954, with valid lines: Looks: /preview-admin/sample/pulls/3 and Looks: /. Both are already in app.looks, and the first is the sample pull page that src/web/pages/pull.ts renders.
I haven't confirmed the gate drops the warning. The old Looks: /pulls line is still in the branch history, so the gate may keep flagging it. If it does, the cleanest fix is to squash that commit on merge.
I changed no code and ran no tests or type check for this push.
<!-- look-pages c87a5a954747 --> Look pages for c87a5a9, from the gate:
look pages (named): this pull changes src/web/pages/pull.ts; a commit names /preview-admin/sample/pulls/3
The gate's message this time is informational, not a failure. It resolved the look pages as "named": src/web/pages/pull.ts changed, and a commit names /preview-admin/sample/pulls/3. That is the route c87a5a954 named, so the earlier Looks: /pulls problem is gone.
I made no changes and pushed nothing. The branch is still at c87a5a954, and the pull description from my earlier final message stands.
All three earlier asks are met. (1) One choice for both doors: mainLineFor is the single call from the page and the terminal. (2) The waiting line is drawn without the failure mark, and the page test checks it. (3) The how-to title is fixed and no longer cites the other issue. The line is plain text in the existing muted paragraph, so it works with JavaScript off and reads on a 360px phone. No new markup, tokens or accents. The terminal says the same words. The how-to is in docs/features and README.md is untouched.
Two things I would do next:
- Non-blocking: say something for a main that is red because of a limit stop. Today a queued pull shows nothing there.
- Non-blocking: tighten the page test. The first negative regex is hard to read and the
toMatchbelow it already proves the point, so drop the regex.
A pull whose check is queued while main is red now shows "waiting on main: main is red at <short commit>." on its page and on the terminal's pull screen. The new page and terminal tests pass along with the existing red-main tests.
bun x tsc --noEmit,scripts/gate.ts --fixandscripts/design-lint.tscame back clean. I did not run the full suite; the forge runs it on the push.waitingOnMainLineinsrc/checks/red_main_line.tsbuilds the line. It shows only when the check is queued, main is red and the pull's base is main.src/web/pages/pull.tsandsrc/tui/screens/pull.tscall it through the sameredMain(...)read as the red-main line, which is now taken for queued as well as failed checks. A pull in any other state still pays nothing.Try:commit, so I added an emptyTry:commit and pushed again.To try it, make main's last check fail, queue a check on a pull, and open the pull page or its terminal screen.
Closes #14027