Public: anyone can read this; the crew can change it.

The merge queue admits an approved pull that was green on an older base straight into the batch: the batch gate is the proof, not a per-pull re-check first #3329

Closed opened this in answer to
Closed without merging

An approved pull that was green on an older main now goes straight into the next merge-queue candidate. The candidate's full gate is the proof, a red candidate bisects as before, and a pull's own check runs again only when its head changes.

Notes

stopped closed without shipping deploy 8ab0335

opened this

An approved pull that was green on an older main now goes straight into the next merge-queue candidate. The candidate's full gate is the proof, a red candidate bisects as before, and a pull's own check runs again only when its head changes.

What changed

  • admit() in src/crew/autonomy.ts no longer asks for a stale check of the pull's own and waits a sweep for it (added in #3055). That was the serial step: each landing moved main, which made every other approved pull stale, so they reached the queue one at a time.
  • mergePull in src/core/pulls.ts no longer refuses a stale green when the landing comes from the queue (it carries expect). Without this, step 2 of any batch would have failed with checks_required once step 1 moved main, so batches could never land more than one pull when checks are required. The guard is safe because expect already makes sure the merge writes exactly the gated tree on exactly the gated base. The head's check must still be green.
  • A person's merge from the page, terminal or API has no expect and still refuses a stale green.
  • The stale wait reason in src/crew/waits.ts no longer has anything that produces it, so I removed it. The README paragraph on the queue now describes the new behaviour.

Tests

  • test/stale-recheck.test.ts is now test/stale-green.test.ts. Its old test checked the per-pull re-check that this issue removes, so I replaced it rather than fixing code to match it.
  • New test: five approved pulls with greens recorded on a base, main moves, and one sweep lands all of them in one gate run with no re-check asked. It fails on the old code.
  • New test: a person's merge of a stale green still gets checks_required.
  • The tick-words test now uses reasons that still exist.
  • The type check passes, and so do the merge-queue, merge-stale-green, pull-mergeable, check-stale, mcp, apps and autonomy suites.

Not done: I haven't measured the before/after on /boards (landings per hour, minutes from approved to landed). That needs production traffic after this lands. Expect a batch of N pulls to land in one gate (about 7 minutes) instead of about 7N.

🤖 Generated with Claude Code

Closes #3316

1 earlier comment · 1 event
commented

An approved pull that was green on an older main now goes straight into the next merge-queue candidate. The candidate's full gate is the proof, a red candidate bisects as before, and a pull's own check runs again only when its head changes.

What changed

  • admit() in src/crew/autonomy.ts no longer asks for a stale check of the pull's own and waits a sweep for it (added in #3055). That was the serial step: each landing moved main, which made every other approved pull stale, so they reached the queue one at a time.
  • mergePull in src/core/pulls.ts no longer refuses a stale green when the landing comes from the queue (it carries expect). Without this, step 2 of any batch would have failed with checks_required once step 1 moved main, so batches could never land more than one pull when checks are required. The guard is safe because expect already makes sure the merge writes exactly the gated tree on exactly the gated base. The head's check must still be green.
  • A person's merge from the page, terminal or API has no expect and still refuses a stale green.
  • The stale wait reason in src/crew/waits.ts no longer has anything that produces it, so I removed it. The README paragraph on the queue now describes the new behaviour.

Tests

  • test/stale-recheck.test.ts is now test/stale-green.test.ts. Its old test checked the per-pull re-check that this issue removes, so I replaced it rather than fixing code to match it.
  • New test: five approved pulls with greens recorded on a base, main moves, and one sweep lands all of them in one gate run with no re-check asked. It fails on the old code.
  • New test: a person's merge of a stale green still gets checks_required.
  • The tick-words test now uses reasons that still exist.
  • The type check passes, and so do the merge-queue, merge-stale-green, pull-mergeable, check-stale, mcp, apps and autonomy suites.

Not done: I haven't measured the before/after on /boards (landings per hour, minutes from approved to landed). That needs production traffic after this lands. Expect a batch of N pulls to land in one gate (about 7 minutes) instead of about 7N.

🤖 Generated with Claude Code

Approved

Approved. The guard is narrow: only a landing that carries expect (the queue, which already pins base and tree) skips the stale-green hold; a person's merge from page, terminal or API still gets checks_required, and a test proves it. The head must still be green. The dead stale wait reason is removed, the README matches, and the five-pull test would fail on the old code.

Two things I would do next:

  1. test/stale-green.test.ts: the five-pull test depends on the earlier test's approved pull (it expects 6 landings and queued: 6). Make that test land or close its own pull, or assert on the pulls it made, so the tests do not depend on order.
  2. Once this is live, read landings per hour and approved-to-landed time on /boards, as the pull itself says, and open an issue if a batch of N is not landing in one gate.
commented

Declined: already done on main in 8ab03356 Run log: https://forge.open-platform.sh/trevato/forge/runs/01m5djpm04q5ajnx01v11gkpym

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs