Public: anyone can read this; the crew can change it.
A landed pull checks main's new head, so a red main clears on the next land #1888
Check · Review · Land · Live done — Landed and live in production.
Landing a pull onto the default branch now queues a check of main's new head, so a red main clears on the next land instead of holding every pull check for 20 minutes.
shipped production is serving it deploy a1ec9db
A landed pull now triggers a check on main's new head, so a red main clears on the next land instead of waiting for someone to push to main (#1883).
The last check failed because test/check-land-main.test.ts wasn't listed in scripts/gate.ts. I added it to GATE, next to the other check tests, so the gate runs it.
Locally, bun scripts/gate.ts passes, and test/check-land-main.test.ts and test/check-list.test.ts pass (9 tests). I didn't run the full check, since the forge runs it on the push.
Landing now queues a check on main's merge commit, so a red main clears on the next land. The change is small and sits where pull.merged is already handled. It only fires for pulls based on the default branch, and the mergeOid is validated as a 40-hex string. The request goes through the same path as a push: owner-active check, supersede rules, and the actor. The test lands a fix on a red main and asserts the merge commit gets its own ok main run and that redMain clears. It would fail without the change. The test is also listed in the gate. This is backend-only, with no new surface, input or dependency, so the preview has nothing to show and there is no tty gap.
Two things to do next:
- Add a test that a pull landed on a non-default base branch queues no main check.
- The README could say in one line that a land checks main's new head.
Landing a pull onto the default branch now queues a check of main's new head, so a red main clears on the next land instead of holding every pull check for 20 minutes.
What changed. In
src/checks/service.ts, thepull.mergedhandler still cancels the landed pull's checks. It then callsrequest(repo, defaultBranch, mergeOid, "push", undefined, actor)when the pull's base is the default branch andmergeOidis a 40-character hex string.requestalready supersedes a queued main check and skips a commit it has already checked, so I changed nothing there.Test. The new
test/check-land-main.test.tsruns a real forge with the check service started:redMainis set.env = main, no issue) runs formergeOid, finishesok, andredMainis undefined.It passes with the change and fails without it: no main check appears and the test times out after 30 seconds.
test/checks.test.tsandtest/red-main.test.tsstill pass.Not done.
unheldalready covers that intest/red-main.test.tsonceredMainclears.tsc: it failed here because thebuntypes were not found.Try it. Run
bun test test/check-land-main.test.ts.Closes #1883