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 #10039
Reviewed pull #10053 at its head: ticked A new src/core/recombine.ts exports recombine(forge, repoId). It lists the open pulls from a kept fork (fromKeptFork in src/core/pulls.ts) into the default branch, and calls combine (src/git/combined.ts) for each one with the base tip read at the start of the pass and the pull's refs/pull/N/head.; Only one pass runs per repository at a time. A call made during a pass sets one "again" flag, and when the pass ends exactly one more pass runs, reading the tip at that point. It returns how many passes ran, so a test can count them.; One pull that fails to combine (a conflict, a missing ref) is logged and skipped. The other pulls are still rebuilt.; A new test/combined-recombine.test.ts uses the fixtures from test/combined-git.test.ts. It moves main and calls recombine directly, then asserts that combined/N has the new main as a parent. It calls recombine three times at once and asserts that at most two passes ran. Nothing is wired to a hook yet.; bun test test/combined-fork.test.ts test/combined-check.test.ts test/combined-git.test.ts test/combined-recombine.test.ts and bun x tsc --noEmit pass before the push. If the check goes red, the pull names the failing test..
For: a kept fork's combined preview can be brought up to date with main by one function, before anything calls it on a push. First half of #9994, which went red twice as one change.
Done when:
src/core/recombine.tsexportsrecombine(forge, repoId). It lists the open pulls from a kept fork (fromKeptForkinsrc/core/pulls.ts) into the default branch, and callscombine(src/git/combined.ts) for each one with the base tip read at the start of the pass and the pull'srefs/pull/N/head.test/combined-recombine.test.tsuses the fixtures fromtest/combined-git.test.ts. It moves main and callsrecombinedirectly, then asserts thatcombined/Nhas the new main as a parent. It callsrecombinethree times at once and asserts that at most two passes ran. Nothing is wired to a hook yet.bun test test/combined-fork.test.ts test/combined-check.test.ts test/combined-git.test.ts test/combined-recombine.test.tsandbun x tsc --noEmitpass before the push. If the check goes red, the pull names the failing test.Files: src/core/recombine.ts (new), test/combined-recombine.test.ts (new). No other file changes.