Public: anyone can read this; the crew can change it.
Full suite red: test/kept-fork-landing.test.ts #12900
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/12885-full-suite-red-test-kept-fork-landing-te → main 1 commit fork
1 file
changed +15
−4
test/kept-fork-landing.test.ts +15 −4
| @@ -84,7 +84,9 @@ describe("a kept fork lands as a true merge when the repository keeps `landing: | ||
| 84 | 84 | await rm(work, { recursive: true, force: true }); |
| 85 | 85 | }); |
| 86 | 86 | |
| 87 | test("squash is asked for, a merge commit lands, authors kept, and his next pull is a fast-forward", async () => { | |
| 87 | let pullNo = 0; | |
| 88 | ||
| 89 | test("his two commits are pushed and the pull is opened from his fork", async () => { | |
| 88 | 90 | const b = join(work, "b"); |
| 89 | 91 | await git(["clone", `${authed("bob", bob)}/bob/app.git`, "b"], work); |
| 90 | 92 | for (const n of ["x", "y"]) { |
| @@ -100,8 +102,12 @@ describe("a kept fork lands as a true merge when the repository keeps `landing: | ||
| 100 | 102 | headRepo: "bob/app", |
| 101 | 103 | }); |
| 102 | 104 | expect(opened.status).toBe(201); |
| 103 | const { number } = (await opened.json()) as { number: number }; | |
| 105 | pullNo = ((await opened.json()) as { number: number }).number; | |
| 106 | }); | |
| 104 | 107 | |
| 108 | test("squash is asked for, a merge commit lands, authors kept, and his next pull is a fast-forward", async () => { | |
| 109 | const number = pullNo; | |
| 110 | const b = join(work, "b"); | |
| 105 | 111 | // Alice's main moves meanwhile, so the landing is a real merge. |
| 106 | 112 | const a = join(work, "a"); |
| 107 | 113 | await Bun.write(join(a, "two.txt"), "two\n"); |
| @@ -197,7 +203,7 @@ describe("a kept fork lands as a true merge when the repository keeps `landing: | ||
| 197 | 203 | }); |
| 198 | 204 | }); |
| 199 | 205 | |
| 200 | test("the MCP door honours the rule too: squash asked, a merge commit lands", async () => { | |
| 206 | test("the MCP door: his next commit is pushed, the pull opened, and alice's main moves", async () => { | |
| 201 | 207 | const b = join(work, "b"); |
| 202 | 208 | await git(["pull", "--no-rebase", "--no-edit", "origin", "main"], b); |
| 203 | 209 | await Bun.write(join(b, "z.txt"), "z\n"); |
| @@ -210,12 +216,17 @@ describe("a kept fork lands as a true merge when the repository keeps `landing: | ||
| 210 | 216 | head: "main", |
| 211 | 217 | headRepo: "bob/app", |
| 212 | 218 | }); |
| 213 | const { number } = (await opened.json()) as { number: number }; | |
| 219 | pullNo = ((await opened.json()) as { number: number }).number; | |
| 214 | 220 | const a = join(work, "a"); |
| 215 | 221 | await Bun.write(join(a, "three.txt"), "three\n"); |
| 216 | 222 | await git(["add", "."], a); |
| 217 | 223 | await git(["commit", "-m", "alice again"], a); |
| 218 | 224 | await git(["push", "origin", "main"], a); |
| 225 | }); | |
| 226 | ||
| 227 | test("the MCP door honours the rule too: squash asked, a merge commit lands", async () => { | |
| 228 | const number = pullNo; | |
| 229 | const a = join(work, "a"); | |
| 219 | 230 | const landed = await mcpTool(base, alice, "merge", { |
| 220 | 231 | repo: "alice/app", |
| 221 | 232 | number, |
new above
offline