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

opened this

Merged 17d 14h ago, 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.

Notes

opened this

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 --fix and scripts/design-lint.ts came back clean. I did not run the full suite; the forge runs it on the push.

  • What changed: waitingOnMainLine in src/checks/red_main_line.ts builds the line. It shows only when the check is queued, main is red and the pull's base is main.
  • Same read: src/web/pages/pull.ts and src/tui/screens/pull.ts call it through the same redMain(...) 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.
  • Tests: The page and terminal tests show the line for a queued check while main is red. They show no line once main is green, or when the check has finished.
  • Left out: There is no new line for a running check, and no wording for a main that is red for a limit stop.
  • Push: The first push was refused by the pre-push hook, which wants a Try: commit, so I added an empty Try: 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

Show 4 earlier items

7 earlier comments
commented

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.md had no row in docs/features/README.md. I added the row. Both tests now pass locally, along with test/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: waitingOnMainLine in src/checks/red_main_line.ts builds the line, and both src/web/pages/pull.ts and src/tui/screens/pull.ts call it. It shows only while the check is queued, 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 under ctrl+k, Pulls.

I didn't run the full suite; the forge runs it on each push.

commented

<!-- 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
commented

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: waitingOnMainLine in src/checks/red_main_line.ts builds 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 in docs/features/README.md.
  • Tests: test/pull-page-red-main.test.ts and test/tui-pull-red-main.test.ts cover 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 under ctrl+k, Pulls.
commented

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:

  1. One choice for both doors: mainLineFor(red, check, baseBranch) in src/checks/red_main_line.ts returns redMainLine for a failed check and waitingOnMainLine for a queued one. The web page and the terminal both call it, and the nested ternaries are gone. waitingOnMainLine no longer takes a checkState argument. Main is only read for a failed or queued check, so a healthy pull pays nothing.
  2. No failure mark on the waiting line: the page drew the red x on it. mainLineFor also returns waiting, and the page draws the icon only for the failed line. A test in test/pull-page-red-main.test.ts checks the queued line has no icon.
  3. How-to title: it no longer cites #14027. The how-to now describes mainLineFor and 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.

commented

<!-- 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
commented

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.

commented

<!-- 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
commented

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.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs