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

A test pins proposing to the parent forge: a forge with no parent link, or another repository, is refused and nothing is sent #7128

Merged opened this

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

Merged

I added `test/parent-forge-refusals.test.ts`. It pins that `proposeToParentForge` returns `no_parent_forge` and sends nothing to the parent in each of the three cases. The new tests and `bun x tsc --noEmit` pass; I did not run the rest of the suite, so the forge's check will be its first run.

shipped production is serving it deploy ad44386

opened this

I added test/parent-forge-refusals.test.ts. It pins that proposeToParentForge returns no_parent_forge and sends nothing to the parent in each of the three cases. The new tests and bun x tsc --noEmit pass; I did not run the rest of the suite, so the forge's check will be its first run.

Each case runs against a stub parent that records every request it receives. The test asserts it recorded none, which also covers git pushes.

  • No parent.json: a forge with no parent file is refused.
  • Another repository: a forge linked to alice/app, with a stored credential, proposing from bob/other is refused.
  • No credential: a link to alice/app with no stored credential, proposing from alice/app, is refused.

I added a fourth test as a control. The same link with a credential does not return no_parent_forge, so the refusals above come from the missing link, repository mismatch or credential, not from a broken fixture.

The action already behaved as the issue describes, so I changed nothing in src/actions/upstream.ts. Nothing outside the new test file was touched.

To try it: bun test test/parent-forge-refusals.test.ts.

Closes #7116

commented

I added test/parent-forge-refusals.test.ts. It pins that proposeToParentForge returns no_parent_forge and sends nothing to the parent in each of the three cases. The new tests and bun x tsc --noEmit pass; I did not run the rest of the suite, so the forge's check will be its first run.

Each case runs against a stub parent that records every request it receives. The test asserts it recorded none, which also covers git pushes.

  • No parent.json: a forge with no parent file is refused.
  • Another repository: a forge linked to alice/app, with a stored credential, proposing from bob/other is refused.
  • No credential: a link to alice/app with no stored credential, proposing from alice/app, is refused.

I added a fourth test as a control. The same link with a credential does not return no_parent_forge, so the refusals above come from the missing link, repository mismatch or credential, not from a broken fixture.

The action already behaved as the issue describes, so I changed nothing in src/actions/upstream.ts. Nothing outside the new test file was touched.

To try it: bun test test/parent-forge-refusals.test.ts.

Approved

Approved. A test-only change that pins the three refusals in src/actions/upstream.ts:209 (no link, other repository, no credential). Each refusal also asserts the stub parent saw no requests. The control test shows the fixture is sound. The cases are isolated: each uses its own data dir and the stub is torn down. There is no UI, input or write surface to review, and no dependency was added. I could not run the new file in my checkout, which is at the base, so I judged it from the diff and the action source. The forge check will be its first run. Two things I would do next: (1) in the no-parent.json case, also store a credential so the refusal can only come from the missing link; (2) drop the unused tip argument in the parentDoc callback, which is always passed as an empty string.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs