Skip to content

Refresh approved PRs in parallel instead of building batch PRs - #1998

Merged
dannyvfilms merged 1 commit into
latestfrom
merge-train/parallel-refresh
Nov 15, 2026
Merged

dannyvfilms merged 1 commit into
latestfrom
merge-train/parallel-refresh

Conversation

@dannyvfilms

Copy link
Copy Markdown
Owner

Replaces the batch-PR approach from #1988/#1989. The train no longer opens PRs or creates branches. It only merges latest into approved PR branches, and GitHub's native auto-merge lands whichever up-to-date PR goes green first.

The old stall

choose() picked one PR per run, and any up-to-date PR with CI running ("in flight") made every other PR wait. That's why green PRs like #1982 and #1970 sat idle behind #1986.

Now

  • Normal lane. Up to MERGE_TRAIN_DEPTH (repo variable, default 3; 1 = old serial train) migration-free PRs are refreshed and testing at once. A PR in flight never blocks the others. Free slots go to the earliest green first, then by approval order. The 2-hour aging rule and the one-time retry of old failures are kept.
  • Migration lane. Any PR whose diff touches src/*/migrations/ goes here, including renames in or out, diffs of 300+ files, and diffs the API couldn't return. These are refreshed one at a time in approval order and must pass migration-order against the latest they merge into.
  • latest stays strict and the three required checks are unchanged. When one PR merges, the others are behind again and get refreshed, so a stale green result can't merge and two clashing migration PRs can't both land.
  • Removed: batch staging, candidate promotion and MERGE_TRAIN_BATCH. Also reverted the batch-only guards in CodeQL, Docker, owner-auto-merge and migration-order. The migration-number checks from Merge green migration-free PRs in cumulative batches; block new duplicate migration numbers #1988 stay.

Tradeoff

With strict on, at most one PR merges per full CI run. This removes idle time but doesn't raise that ceiling. Of the PRs tested together, only the first to go green merges, and the others rerun. That's up to depth - 1 discarded runs per merge.

Verification

After merging

  • Close Merge train batch: #1982, #1970 #1995 (the leftover batch PR) and delete its merge-train/batch-* branch. The new train ignores it because it has no auto-merge.
  • Optionally delete the MERGE_TRAIN_BATCH repo variable; it's unused now.

🤖 Generated with Claude Code

The merge train picked one PR per run, and any up-to-date PR with CI running
made every other green PR wait for it. #1988/#1989 worked around that by
merging several PRs into a separate batch PR and testing that, which is not
how the queue should behave.

Remove the batch lane entirely. The train now only ever merges latest into
approved PR branches, in two lanes:

- normal: up to MERGE_TRAIN_DEPTH (default 3) PRs refreshed and testing at
  once; an in-flight PR never blocks the rest; earliest green goes first,
  with the existing aging rule and one-time retry of old failures.
- migration: any PR touching src/*/migrations/ (renames and truncated or
  unreadable diffs included) is refreshed one at a time in approval order.

latest stays strict, so a stale green result still cannot merge and two
migration PRs cannot both land without the second retesting. Batch-only
guards in CodeQL, Docker, owner-auto-merge and migration-order are reverted;
the migration-number checks from #1988 stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T02:20:08.124799Z ddd0567 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the auto-merge GitHub auto-merge is enabled label Nov 15, 2026
@dannyvfilms
dannyvfilms disabled auto-merge November 15, 2026 03:01
@github-actions github-actions Bot removed the auto-merge GitHub auto-merge is enabled label Nov 15, 2026
@dannyvfilms
dannyvfilms merged commit 19cb0b0 into latest Nov 15, 2026
29 of 31 checks passed
@dannyvfilms
dannyvfilms deleted the merge-train/parallel-refresh branch November 15, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant