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

A pull's check runs on its head merged into today's base, and records the base it checked #1573

Closed opened this
Closed without merging

A pull's check now records which base it was checked against, and the pull page, the change page and the MCP pull tool all show it.

Notes

stopped closed without shipping deploy 42dd55e

opened this

A pull's check now records which base it was checked against, and the pull page, the change page and the MCP pull tool all show it. Most of the issue was already on main: src/checks/merged.ts already checks a temporary merge of the head into the base's current tip, and a pull that does not merge already fails at once with "does not merge into main: <paths>" and runs no command. What was missing was storing and showing the base.

What changed

  • New column: migration 76 adds run.base_oid, and Run has a matching baseOid field. In src/checks/service.ts, runTier saves the base tip before it tries the merge, so a pull that does not merge still names the base it failed against.
  • One base per check: the base's forge.json (which decides the check command) is now read from that same tip. Before, the base branch was looked up a second time, which could give a different commit.
  • Default branch: a push to the default branch is checked on its own commit, as before, and baseOid stays empty.
  • What a person sees: the checks line reads "deploy abc1234 · checked on main@def5678". The wording comes from one helper, checkedOn in src/checks/merged.ts, used by both pages.
  • MCP: pull returns check: { state, summary, commitOid, baseOid, checkedOn } for the newest check of the head, or null. It is limited by mayReadRuns, so a private app's runs stay hidden from someone who cannot enter the app.
  • Unchanged: the sealed-pull path (pullDir) and the skip for forks that silently followed.
  • Docs: docs/APPS.md describes the merged check and baseOid.

Tests

  • New in test/checks.test.ts: a pull is green against the base, then the base gains a file that together with the pull's file turns the base's check red. Asked again on the same head, it reads red. The test also checks:
    • each run's baseOid is the base tip it was checked against;
    • the default-branch run's baseOid is empty;
    • the run log names the merge;
    • every ref in the bare repo is the same before and after the check;
    • the pull page shows "checked on main@…";
    • the MCP pull tool returns the same base.
  • test/check-tiers.test.ts: the existing conflict test now also asserts that the failed run names its base and that its log contains no command.
  • bun x tsc --noEmit: clean.
  • bun test test/checks.test.ts test/check-tiers.test.ts: 48 pass, 0 fail.
  • bun test on the five cross files (reserved-names, studio, shards, check-list, hollow) plus mcp, pull-mergeable, schema-migrations, pulls, asks-rank: 318 pass, 0 fail.
  • test/pull-check-again.test.ts: 4 pass.

The earlier attempt, #1536, was red on asks-rank. That test passes on today's main: it was broken there by an unrelated merge and fixed in a5a3f429, so nothing in this pull changes it.

What I chose not to do

  • Merge objects: the merge is never written to a branch or any ref. Its tree and commit objects do stay in the bare repo as unreferenced objects, which git's garbage collection removes.
  • Conflicting pulls: a pull that does not merge still gets a run row, but no command runs. That failed run is where it says so.
  • Base moves: a push to the base does not re-check open pulls. The new base is used the next time the pull's branch moves or someone presses "Check again".
  • Screenshot: I can't take one of the preview from this sandbox, so it still needs adding. To see it by eye, open any open pull on the preview and read its checks line, or call the MCP pull tool and read check.checkedOn.

🤖 Generated with Claude Code

Closes #1178

commented

Parked by the crew: the check failed ("asks that expire, hold and collapse > two green pulls in one repository are one row, and every surface counts it once") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs