Skip to content

Merge queue: PRs land in tested trains, the queue gives the build numbers - #500

Merged
k06a merged 2 commits into
mainfrom
claude/project-thread-n5wg8s
Dec 2, 2026
Merged

k06a merged 2 commits into
mainfrom
claude/project-thread-n5wg8s

Conversation

@k06a

@k06a k06a commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Requested by Anton · project thread "Make all tests green and gate merges"

What

A merge queue. A thread now merges with one command, node tools/merge.mjs <pr> --wait, which labels the PR queue. The queue (tools/queue.mjs, .github/workflows/queue.yml, one run at a time) works in trains:

  1. Train: main's tip plus the waiting PRs in order (six at most), each merged on the one before. Release files are made anew: the PR's notes get the next free build number, its tools/shots/<n>.mjs is renamed to it, index.html and version.json are rebuilt. Language packs and tools/test-times.json are merged by key, the window.G line of 99_main.js by name, docs keeping both sides. Any other conflict puts the PR out of the queue with the files named.
  2. Tests: the whole suite on the tip of the train (the state main will really have). Failed jobs run once more.
  3. Green: main moves to the tip, the PRs show as merged, Pages and the release screenshots start, each PR gets a comment with its build number. Red: the failing tests are first run on main itself; what is red there does not block. Otherwise they are run on each step of the train and the first PR that turns them red leaves the queue.

Why

Every PR carried the next build number, its notes, its screenshot list and the built bundle, so two PRs always collided. Each merge sent every other open PR round a merge-main, renumber, rebuild, wait-for-CI loop: seven open PRs all said "Build 468", and #466 waited an hour. And CI tested the branch, not main with the PR in it. GitHub's own merge queue is not offered for a repository of a personal account.

Checked

  • tools/queue.test.mjs (new): notes renumbering, JSON and window.G merging, whole PRs and a train on a scratch repository, refusals.
  • The combiner on today's 16 open PRs: 15 combine with main untouched; 11 of 15 fit one train (builds 468 to 476 given by the queue); the rest are real conflicts in generator versions, golden hashes and code.
  • With the real bundle build: a PR with no change to the game gets no build (byte-identical bundle), a PR with notes gets 468.
  • The GitHub side (pushes by the workflow token, starting runs) can only be proven live: I watch the first trains.

Also changes

  • tests.yml no longer runs on every push of every PR: that took all the runners, and the branch is not what lands. Hand runs of chosen tests on a branch stay. cancel-stale.yml is removed (nothing left for it to cancel).
  • tools/merge.mjs --direct keeps the old gate, only for PRs that change workflow files (the workflow token may not push those).
  • docs/ARCHITECTURE.md §5 and §6: the new merge rule.

Generated by Claude Code

…state; the queue gives the build numbers

Every PR carried the next build number, its notes under that number, the screenshot list of that number and the
built index.html, so two PRs always collided and each merge sent every other open PR round a merge-main, renumber,
rebuild, wait-for-CI loop (seven open PRs all said "Build 468"). And what was tested was the branch, not main with
the PR in it. GitHub's own merge queue is not offered for a repository of a personal account.

tools/queue.mjs (queue.yml, one run at a time): main plus the PRs labelled "queue", in order. Release files are made
anew (notes renumbered, tools/shots/<n>.mjs renamed, bundle rebuilt); language packs, test times, the window.G line
and docs are merged by meaning; any other conflict puts the PR out with the files named. Every test runs on the tip
of the train, failed jobs once more; green moves main there and starts Pages and the release screenshots; red finds
the PR that turned the tests red. Only a test that is green on main blocks; what is red on main is kept on the
branch queue-data and can only shrink.

tools/merge.mjs <pr> now puts the PR into the queue (--direct: the old gate, for workflow changes only).
tests.yml no longer runs on every push of every PR (that took all the runners); cancel-stale.yml is not needed.
docs/ARCHITECTURE.md §5 and §6 tell the new rule. tools/queue.test.mjs tests the combiner on a scratch repository.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdrPyoU594YpAeAd6En
@k06a k06a self-assigned this Dec 2, 2026
@k06a
k06a merged commit fdff03a into main Dec 2, 2026
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.

2 participants