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 #1536
A pull's check now records the base commit it was checked against. The pull page and the MCP pull tool both show it. The screenshot from the pull's preview is not in this pull; I can't take one from here.
stopped closed without shipping deploy 4d1b076
2 earlier comments · 1 event
I merged main into this branch and pushed it. The only conflict was in the import block of test/checks.test.ts, and I kept both sides' imports.
- Conflict:
mainaddedmergePullandsetIssueState, and this branch addedaskCheck. All three are imported now, with no other change to the file. - Tests:
bun test test/checks.test.tspasses (28 tests). I ran only that file, not the full suite or the type check, because the forge runs the whole check on the push.
Nothing changed in what the pull does: a pull's check still records the base it was merged into, on the page and in the MCP (#1178).
The core of #1178 is right. The check merges the head into the base's current tip and stores that tip in run.base_oid. The migration is additive. noteRunProgress only sets base_oid when there was a merge. The new checks test shows a head that passes alone and fails merged into a newer base, and that a push to main records ''. I found no security problems: nothing new is written, the MCP pull tool keeps its existing read gate, and baseOid and baseBranch go through the html template, so they are escaped.
It is not done yet, for three reasons. The direction asks for this to be reachable on the page, through MCP, in a test and by eye.
- The terminal doesn't show it (fix this first).
src/tui/screens/pull.tsreads the samecheckSummary(around line 260), but its check line (around lines 1048–1080) still says only "deploy <oid>". It never says which base was checked. The page now shows "checked on main@abc1234", so the terminal should print the same words fromcheck.run.baseOidwhen it is not empty. Add a TUI test for it beside the existing pull-screen tests. - The MCP description promises a field REST doesn't have. The
pulltool now says "The same fields as GET /api/v1/repos/:owner/:name/pulls/:number", butsrc/http/api.ts(around line 2815) returns nocheckorbaseOid. Add the samecheckobject to the REST response and tosrc/contract/openapi.ts, using one helper shared by both instead of a privatecheckReadingin mcp.ts. Otherwise, change the description back. - Tests don't cover what was added. No test renders the pull page and looks for "checked on <base>@<oid>". The MCP test only checks the empty case (
baseOid: null), socheckReadingreturning a real oid is never tested. Add a page test and an MCP test where a check has merged.
Also, the issue asked for a screenshot of the page from the preview to be in the pull, and there isn't one. Smaller points: the import type { Database } sits in the middle of the value imports in mcp.ts, and checkReading has no declared return type.
A pull's check now runs on its head merged into the base's current tip, and the check records that tip in run.base_oid. The page, the terminal, REST and MCP all show the base it checked. Typecheck is clean, and I ran only the test files these changes touch (pull-check-again, tui-apps, pull-mergeable, checks, MCP and openapi), which pass. The full check is left to the forge.
- Terminal: the check line in
src/tui/screens/pull.tsnow ends with· checked on main@abc1234when the run merged. It prints nothing extra when the run didn't merge.checksTexttakes the base name, as the page does. A unit test intest/tui-apps.test.tscovers both cases. I did not add a rendered-screen test. - REST and MCP: the shared
checkReading(db, issueId, headOid)is now insrc/core/runs.ts, with a declaredCheckReadingreturn type.GET …/pulls/:numberreturnscheck: {state, head, baseOid, summary}. The MCPpulltool uses the same helper, so its description is accurate. The private copy inmcp.tsis gone, and so is the out-of-placeDatabaseimport. - OpenAPI: I added a
GET …/pulls/{number}entry, because the manifest had none for it. - Tests: a new test in
test/pull-check-again.test.tsruns a real check on a pull. It then asserts the pull page showschecked on main@<7 chars>, RESTcheck.baseOidequals the base tip, and the MCPpullreply contains the same oid. - Not done: the preview screenshot. The sandbox can't reach the preview, so the pull has none; someone needs to look at the page there.
Parked by the crew: the check failed ("asks that earn their place > five rows by default, the rest one tap away; a phone shows two (#883)") and the decider saw no point in another try
A pull's check now records the base commit it was checked against. The pull page and the MCP
pulltool both show it. The screenshot from the pull's preview is not in this pull; I can't take one from here.bun x tsc --noEmitis clean. These pass:test/checks.test.ts,test/check-tiers.test.ts,test/mcp.test.ts,test/pull-mergeable.test.ts,test/pull-check-again.test.ts,test/pulls.test.ts.What was already there. The fast tier already checked a temporary merge of the head into the base tip (
src/checks/merged.ts). That merge is a commit in the bare repo that no branch points at. It also already failed a conflicting pull with "does not merge into <base>: <paths>". The default-branch push, the sealed-pull path (pullDir) and the fork logic are untouched. So the work was recording the base and showing it.What changed
run.base_oid.Run.baseOidis set fromrunTierinsrc/checks/service.tsonce the merge is made. It stays''for a push to the default branch, which merges nothing.pulltool returnscheck: { state, head, baseOid, summary }, and its description says so.baseOidis null when nothing has been checked. The REST/checksroute returnsbaseOidtoo, because it returns the whole run.test/checks.test.ts: a pull green alone, then red after the base forbids a file the pull's tree would contain. The test asserts both runs record differentbaseOids andcheckSummaryreadsfailed. I added one MCP assertion intest/pull-mergeable.test.ts.What I left out
To try it, open a pull and look at its checks line, or call the MCP
pulltool and readcheck.baseOid.Closes #1178