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 #1188

Closed opened this
Closed without merging

A conflicted pull now says "Conflicts in N files" first and shows no green mark. I couldn't run any test here, because the sandbox refuses the unix socket the app's test server listens on. bun x tsc --noEmit is clean.

Notes

stopped closed without shipping deploy 01c84b4

opened this

A conflicted pull now says "Conflicts in N files" first and shows no green mark. I couldn't run any test here, because the sandbox refuses the unix socket the app's test server listens on. bun x tsc --noEmit is clean. test/pull-conflicts.test.ts is new and unrun, and I didn't get a clean run of test/pulls.test.ts or test/studio-words.test.ts either. The forge's check will be the first real run.

What changed

  • API: GET …/pulls/:number now carries top-level mergeable (boolean) and conflicts (file paths). They come from the existing pullStatus (git merge-tree --write-tree against the base's live head). The nested status object is unchanged.
  • Caching: pullStatus now caches the verdict by (repo dir, base oid, head oid), 512 entries. Work happens only when a pull is viewed or listed, and the cache is reused until either oid moves. Timeouts and unsafe-oid errors are not cached.
  • Pull page: checksLine takes a conflict count. When it's above zero it renders "Conflicts in N files" with the alert icon, even if the head's check passed.
  • Inbox, feed and board rows: these share pullWord in src/web/studio/words.ts. An open pull with conflicts now reads stopped with the note "Conflicts in N files" instead of "green — ready for a look". Each such row now resolves two refs, which is the extra cost; the merge-tree itself is cached.
  • Test file: test/pull-conflicts.test.ts covers three things:
    • A pull made to conflict reads conflicted in the API and on the page, and merging main into the branch clears both.
    • checksLine shows no "Checks passed" when conflicts are present.
    • The conflict wording is checked directly.

Left out

  • The pull list endpoint (GET …/pulls) doesn't carry mergeable or conflicts. It would cost a merge-tree per row, so I left it as a follow-up.
  • The terminal pull screen (tui/screens/pull.ts) still says "checks: passed". Its merge box already blocks on conflicts.
  • I exported checksLine only so the test can call it.

Try it Push two branches that edit the same line, open a pull, then curl …/api/v1/repos/:o/:n/pulls/1. Merge the base into the branch and push, and the page and API both go clean.

Closes #1177

2 earlier comments
commented

scout only (reviewers: not for you): the check on this pull is red. Read the failing tests in the check log, fix them on this branch and push, or say in one line why the red is not yours.

commented

A conflicted pull now returns mergeable and conflicts on the pull JSON and says "Conflicts in N files" first on the pull page, never with a green mark. The studio inbox, feed and board rows no longer change. I couldn't run any tests here. The sandbox blocks the unix socket the test server needs, so test/studio.test.ts fails 68 of 79 tests locally. bun x tsc --noEmit was clean on the first pass. After the final edit I only checked that it no longer reports the missing conflictsPhrase export, so I did not re-run it in full. The forge's check on the new push will be the first real run.

Why the check was red. One test failed: studio > a change that no longer merges into its base says so, and offers no Ship. My first commit made pullWord in src/web/studio/words.ts return stopped for any open pull with conflicts. That test, and the studio's five-word design, require a conflicted green pull to stay data-word="look". The studio already says the conflict itself in change.ts, and I should have read that first.

Change in this push. I took the conflict check back out of pullWord, so the studio rows read as they did before. I kept conflictsPhrase, since src/web/pages/pull.ts uses it. The API fields, the cached pullStatus, the conflict line on the pull page and test/pull-conflicts.test.ts are unchanged.

Left out, as before.

  • GET …/pulls (the list) doesn't carry mergeable or conflicts, because that would cost a merge-tree per row.
  • The terminal pull screen still says "checks: passed".

Closes #1177

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs