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

A pull that conflicts with its base says so first: `mergeable` and `conflicts` on the pull, and never a green mark #1321

Closed opened this
Closed without merging

A pull that conflicts with its base now says "Conflicts in N files" first and shows no green mark. bun x tsc --noEmit and test/check-list.test.ts pass here.

Notes

stopped closed without shipping deploy 41dabe3

opened this

A pull that conflicts with its base now says "Conflicts in N files" first and shows no green mark. bun x tsc --noEmit and test/check-list.test.ts pass here. I could not run test/pull-conflicts.test.ts, test/pulls.test.ts or test/studio-words.test.ts, because the sandbox blocks the unix socket their test server listens on. The forge's check will be the first real run of those three.

This replaces the closed #1188. I changed two things on top of it:

  • Merged main. The branch had fallen behind and now conflicted with main in src/web/pages/pull.ts, which is what this issue is meant to catch. I kept both conflicts and main's new tier argument on checksLine.
  • Added the new test to the gate. test/pull-conflicts.test.ts is now in GATE in scripts/gate.ts. test/check-list.test.ts goes red when a test file is in neither list, so the missing entry is my best guess at why #1188's check failed.

What changed in the feature:

  • API: GET …/pulls/:n now carries top-level mergeable and conflicts. They come from git merge-tree --write-tree against the base's live head. The nested status object is unchanged.
  • Cache: the result is kept per (repo dir, base oid, head oid), 512 entries. It is recomputed only when either oid moves. Timeouts and unsafe-oid errors are not cached.
  • Pull page: the checks line reads "Conflicts in N files" with the alert icon, even when the head's check passed.
  • Inbox, feed and board rows: a conflicted open pull reads "stopped" with the note "Conflicts in N files", not "green — ready for a look".
  • Tests: test/pull-conflicts.test.ts makes a pull conflict and expects the API and the page to say so. It then merges main into the branch and expects both to clear. It also checks that checksLine never shows "Checks passed" when there are conflicts.

What I left out:

  • Pull list endpoint: GET …/pulls doesn't carry the fields, since that would cost a merge-tree per row.
  • Terminal pull screen: it still says "checks: passed", though its merge box already blocks on conflicts.
  • MCP: this repository has no MCP code, so the pull JSON is the only change there. I did not check that asks never shows a conflicted pull as green.
  • Look: I haven't taken the screenshot from the preview.

To try it, push two branches that edit the same line and open a pull. Then curl …/api/v1/repos/:o/:n/pulls/1 and look at the page. Merge the base into the branch and push, and both clear.

Closes #1177

🤖 Generated with Claude Code

Closes #1177

commented

Parked by the crew: the check failed ("the look > a public app made private after its pictures were taken: a reader gets them no more, and no Look card; its writer still does (#845)") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs