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

A test pins finishing a conflict from the forge: a stale head, a pull with no conflict, or the wrong path is refused #7100

Merged opened this

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

Merged

I added `test/finish-conflicts-refusals.test.ts`, which pins what `finishConflicts` does on success and on each refusal. All 6 tests pass and `bun x tsc --noEmit` is clean. I ran only this test file; the forge runs the full check.

shipped production is serving it deploy d5b2fe2

opened this

I added test/finish-conflicts-refusals.test.ts, which pins what finishConflicts does on success and on each refusal. All 6 tests pass and bun x tsc --noEmit is clean. I ran only this test file; the forge runs the full check.

  • Success: a pull that conflicts on one file is finished with that file's resolution. Afterwards it is mergeable and has no conflicts, and the head has moved.
  • stale: a head that moved after the page was read, and a base that moved after the page was read, are each refused.
  • no_conflicts: a pull with no conflict is refused.
  • not_resolvable: a path that is not the conflicting file is refused. A pull that conflicts on two files is refused whichever of the two paths is sent.
  • Head unchanged: after every refusal the head branch is the same commit as before.

The test found nothing wrong, so src/actions/finish-conflicts.ts is untouched.

To try it, run bun test test/finish-conflicts-refusals.test.ts.

I left out the other refusals (closed, elsewhere, incomplete, protected_branch), since the issue named only these three.

Closes #7088

commented

I added test/finish-conflicts-refusals.test.ts, which pins what finishConflicts does on success and on each refusal. All 6 tests pass and bun x tsc --noEmit is clean. I ran only this test file; the forge runs the full check.

  • Success: a pull that conflicts on one file is finished with that file's resolution. Afterwards it is mergeable and has no conflicts, and the head has moved.
  • stale: a head that moved after the page was read, and a base that moved after the page was read, are each refused.
  • no_conflicts: a pull with no conflict is refused.
  • not_resolvable: a path that is not the conflicting file is refused. A pull that conflicts on two files is refused whichever of the two paths is sent.
  • Head unchanged: after every refusal the head branch is the same commit as before.

The test found nothing wrong, so src/actions/finish-conflicts.ts is untouched.

To try it, run bun test test/finish-conflicts-refusals.test.ts.

I left out the other refusals (closed, elsewhere, incomplete, protected_branch), since the issue named only these three.

Approved

Test-only pull. It pins success, stale head, stale base, no_conflicts and not_resolvable (one-file and two-file) against the real finishConflicts error codes, and asserts the head is untouched after every refusal. Small, no dependency, no dead code, and the pull is green. Next: (1) pin the remaining refusals (closed, elsewhere, incomplete, protected_branch) as follow-ups; (2) add a test through the page/MCP door so the refusal wording reaches a person, not just the action.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs