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

A production deploy records which merged pulls it carries #1753

opened this

Merged 50d 11h ago, live in production

A finished production deploy now records which merged pulls its commit carries, but I haven't run a real deploy to see it end to end. The tests exercise the git walk and the table directly; the deploy hook is covered only by the type check.

Notes

opened this

A finished production deploy now records which merged pulls its commit carries, but I haven't run a real deploy to see it end to end. The tests exercise the git walk and the table directly; the deploy hook is covered only by the type check.

  • How it works: one git rev-list of the deployed commit finds every merged pull whose merge commit is in that history. Each is written to a new deploy_pull table (migration 85 in src/core/schema.ts). src/core/carried.ts holds recordCarried and carriedBy.
  • Where it runs: src/apps/runtime.ts calls it when a production deploy finishes OK. A failure is logged and never fails the deploy.
  • Tests:
    • test/carried.test.ts is added to GATE in scripts/gate.ts.
    • A deploy of a commit carrying two merges records both, and a third merge made after it is not recorded.
    • Recording twice is the same as once, and a commit that isn't an object id records nothing.
    • asks, asks-expiry, check-list and the schema tests pass, and tsc is clean.
  • Left out:
    • Nothing reads the table yet (the ask-to-live and flow pages still compute their own).
    • Previews are not recorded.
    • Existing deploys are not backfilled.
    • A history longer than 200,000 commits is cut off, so a deploy records only the pulls within that walk.

To try it, merge two pulls and then deploy production. SELECT * FROM deploy_pull should show both pulls against that run.

🤖 Generated with Claude Code

Closes #1600

9 earlier comments
commented

A finished production deploy now records the merged pulls its commit carries, and you can read that on three surfaces. This was run for the review; the earlier tests, tsc and the asks/check-list suites pass, but the forge's full check hasn't run yet.

  • Recording: git rev-list of the deployed commit, run once when the deploy finishes (src/core/carried.ts), writes a deploy_pull row for each merged pull in that history (migration 85 in src/core/schema.ts). The write is idempotent, the commit id is validated before it reaches git, the walk is capped, and a failure is logged without failing the deploy. The migration comment now cites pull #1753 and issue #1600.
  • Run page: a production deploy's run page shows "Carries #3, #5" with links to those changes. It sits on the existing run page, so it has that page's read gating.
  • API: GET /api/v1/repos/:owner/:name/runs/:id now returns carries: number[]. It goes through the same repo and run access check as before.
  • Terminal: the run lists in the terminal UI (src/tui/screens/runlist.ts) append carries #3 #5 to a deploy's summary line.
  • README: one bullet describes the recording and the three places to read it.
  • Test for the hook: test/carried-deploy.test.ts runs a real deploy of a new app in the test, merges two pulls, and waits for the production run to finish OK. It then checks the deploy_pull rows, the API's carries, the page's #run-carries link, and the terminal row text. With the noteCarried call commented out, it times out and fails. It is in GATE, along with test/carried.test.ts.

I did not add an MCP tool, because MCP has no run-detail tool to extend. The API's carries is the programmatic read.

commented

A production deploy now records the merged pulls it carries. The run page says "Carries #3, #5", and GET /api/v1/repos/:owner/:name/runs/:id returns carries. The terminal shows nothing about it.

Review fix: @sentinel was right that no terminal screen ever holds a deploy run. The only run lists are the issue and pull crew lists, and both are filtered to kind: "agent" for one issue. I took the second option you offered rather than build a deploy list in this pull:

  • I reverted the terminal wiring in src/tui/screens/runlist.ts, since it could never be reached.
  • The README no longer claims the terminal shows carries. It says there is no terminal list of deploys yet.
  • I dropped the hand-built runRows assertion from test/carried-deploy.test.ts. The test now covers only the recording, the API and the page.
  • A terminal deploy list gated by listRepoRuns that shows carries #3 #5 is now issue #1762, to be tested through the screen.

tsc --noEmit is clean and bun test test/carried passes. I did not run the full suite. A port-mode sandbox run cannot start apps contained, so the forge's check will run the rest.

commented

I couldn't find what failed in the check. The log you sent ends at the test command, with no failing test named. I merged main (it had moved to 00013984) into the branch and pushed 7a526a02, so the forge will re-check against current main. I haven't confirmed that the merge was the cause.

Local results:

  • Type check: tsc --noEmit is clean after the merge.
  • Targeted tests: test/carried* and test/schema* pass after the merge.
  • Fast tier before the merge: 3 of 6 shards failed, none in anything this pull touches.
    • The chromium capture test (the look > a real capture through the grant door) failed. I didn't investigate it, but chromium is probably unavailable in this sandbox.
    • Shards 2 and 4 were killed at 60 s (exit 143), most likely by load here.
    • I didn't rerun the fast tier after the merge.

If the check fails again, send the full log.

commented

I merged main into the branch and pushed it as 6b8dfb9e. The only conflict was in src/core/schema.ts.

main had already taken migration 85 for the standing-rule column repo.decisions_by (#1605). I kept that migration as it was. The deploy_pull table for this pull is now migration 86, placed after it. Migrations are applied by position, so this is the order an existing database would have run them.

tsc --noEmit is clean, and test/carried* and test/schema* pass (19 tests). I didn't run the full suite. The forge's check will run it on this push.

commented

The full gate on land was red and named no test; the pull is open again.

commented

The full gate on land was red and named no test; the pull is open again.

commented

The full gate on land was red and named no test; the pull is open again.

commented

The full gate on land was red and named no test; the pull is open again.

commented

The full gate on land was red and named no test; the pull is open again.

commented

The full gate on land was red and named no test; the pull is open again.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs