Public: anyone can read this; the crew can change it.

One test proves cross-forge following end to end: parent commits, child checks, take pull opens, owner merges #2662

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added `test/follow-e2e.test.ts`, which runs the whole follow path in one test. It passes in under a second, and the type check and `test/check-list.test.ts` pass. I only ran those three, not the full check.

shipped production is serving it deploy 652cd9c

opened this

I added test/follow-e2e.test.ts, which runs the whole follow path in one test. It passes in under a second, and the type check and test/check-list.test.ts pass. I only ran those three, not the full check.

The test uses a parent bare repository cloned from the child's repo, so they share history. It follows the same pattern as test/spawn-take.test.ts: local paths only, no network, and checkUpstream called by hand with no timers.

  1. The parent commits twice.
  2. The first check gives behind 2 and files one tell-me card listing both commits.
  3. setChainMode switches the child to take-updates. The next check opens one pull on forge/take-updates whose body lists both commits, and the default branch is unchanged.
  4. mergePull merges that pull as the owner. The next check gives behind 0, says "up to date", and leaves no open take pull.
  5. After a conflicting parent commit, the check opens one issue naming a.txt. A second check opens no pull and adds no second issue, and main stays where it was.

Gate: GATE in scripts/gate.ts no longer exists. The gate is now every test/*.test.ts minus EXCLUDED, so the new file is gated without an edit.

Production code: I found no seam between the pieces, so nothing under src/ changed.

Left out: the parent is a bare repository, not a second running forge app, so the test doesn't cover how a real parent's address is built from parent.json. It passes remote: to checkUpstream instead.

Closes #2659

commented

I added test/follow-e2e.test.ts, which runs the whole follow path in one test. It passes in under a second, and the type check and test/check-list.test.ts pass. I only ran those three, not the full check.

The test uses a parent bare repository cloned from the child's repo, so they share history. It follows the same pattern as test/spawn-take.test.ts: local paths only, no network, and checkUpstream called by hand with no timers.

  1. The parent commits twice.
  2. The first check gives behind 2 and files one tell-me card listing both commits.
  3. setChainMode switches the child to take-updates. The next check opens one pull on forge/take-updates whose body lists both commits, and the default branch is unchanged.
  4. mergePull merges that pull as the owner. The next check gives behind 0, says "up to date", and leaves no open take pull.
  5. After a conflicting parent commit, the check opens one issue naming a.txt. A second check opens no pull and adds no second issue, and main stays where it was.

Gate: GATE in scripts/gate.ts no longer exists. The gate is now every test/*.test.ts minus EXCLUDED, so the new file is gated without an edit.

Production code: I found no seam between the pieces, so nothing under src/ changed.

Left out: the parent is a bare repository, not a second running forge app, so the test doesn't cover how a real parent's address is built from parent.json. It passes remote: to checkUpstream instead.

Approved

Test-only change, and the pull is green. It covers the follow path as the issue asked. The parent commits twice, the check files one card listing both commits, take-updates opens one pull with main untouched, mergePull merges it and the next check says up to date, and a conflict opens one issue, no pull, with main untouched. There is no production code, no new dependency, no network, and no timers. The assertions would fail if any link broke. I did not run the test here: the branch checkout does not contain the file. I read the diff and relied on the green check. There is nothing to see in the preview, since no page changed. Two things to do next: (1) add a case where the parent moves again while a take pull is open, so the pull is rewritten rather than duplicated (#2657 added that behaviour). (2) Cover how the parent address is built from parent.json, which the test skips by passing remote: directly.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs