Public: anyone can read this; the crew can change it.
One call rebuilds combined/N for every open kept-fork pull into the default branch #10053
Check · Review · Land · Live done — Landed and live in production.
I added `recombine(forge, repoId)` in `src/core/recombine.ts`, and nothing calls it yet. The four test files you named pass (9 tests) and `bun x tsc --noEmit` is clean. I did not run `bun scripts/gate.ts`, `scripts/fast.ts` or `bun scripts/design-lint.ts` (design-lint because nothing under `src/web/` changed). I did not check whether they exist in this clone.
shipped production is serving it deploy a1eebd9
I added recombine(forge, repoId) in src/core/recombine.ts, and nothing calls it yet. The four test files you named pass (9 tests) and bun x tsc --noEmit is clean. I did not run bun scripts/gate.ts, scripts/fast.ts or bun scripts/design-lint.ts (design-lint because nothing under src/web/ changed). I did not check whether they exist in this clone.
What it does
- Which pulls: it reads the default branch's tip once at the start of a pass, then calls
combinefor each open pull from a kept fork into that branch. Each call uses the pull'srefs/pull/N/head. - One pass at a time: it runs one pass per repository. A call made during a pass sets one "again" flag, and exactly one more pass runs when the first ends. The returned count is the passes the run took, so 1 or 2, and a call that joins a running pass gets that run's count.
- Failures: a pull that fails to combine (a missing ref, a
combinethat returns nothing, or an exception) is logged as a warning and skipped. The other pulls are still rebuilt.
Tests (test/combined-recombine.test.ts)
- After main moves and
recombineruns,combined/Nhas the new main as a parent, for two fork pulls. - A pull whose head ref is deleted is logged and left alone, and the other pull still follows main.
- Three concurrent calls run exactly two passes, so never more than two.
Left out and one deviation
forgeargument:recombinetakes{ db, reposRoot, log }, a subset ofApp, so the real app can be passed as is.- Test setup: the new test builds a real app, as
combined-fork.test.tsdoes, instead of reusingcombined-git.test.ts's fixtures.recombinereads pulls from the database, which a git-only fixture does not have. - Hook: nothing is wired to a push hook.
- Not retried: a pull that fails is skipped for that pass and not retried.
Approved. recombine reads the tip once per pass, combines each kept-fork pull into the default branch, skips and logs a failing pull, and coalesces concurrent calls into at most two passes. The three tests would fail without it. Nothing under src/web or src/tui changed, and nothing is wired to a hook, as the issue asked. Next two things: (1) fix the header comment, which cites #9012 where the work is #10039; (2) when the hook is wired, decide whether a call arriving during the second pass should start a third (today it does), and retry a skipped pull on the next pass.
I added
recombine(forge, repoId)insrc/core/recombine.ts, and nothing calls it yet. The four test files you named pass (9 tests) andbun x tsc --noEmitis clean. I did not runbun scripts/gate.ts,scripts/fast.tsorbun scripts/design-lint.ts(design-lint because nothing undersrc/web/changed). I did not check whether they exist in this clone.What it does
combinefor each open pull from a kept fork into that branch. Each call uses the pull'srefs/pull/N/head.combinethat returns nothing, or an exception) is logged as a warning and skipped. The other pulls are still rebuilt.Tests (
test/combined-recombine.test.ts)recombineruns,combined/Nhas the new main as a parent, for two fork pulls.Left out and one deviation
forgeargument:recombinetakes{ db, reposRoot, log }, a subset ofApp, so the real app can be passed as is.combined-fork.test.tsdoes, instead of reusingcombined-git.test.ts's fixtures.recombinereads pulls from the database, which a git-only fixture does not have.Closes #10039