Skip to content

docs: PRs and deploys say whether a rollback is safe - #795

Merged
allisonmahmood merged 3 commits into
mainfrom
docs/788-rollback-answers
Oct 19, 2026
Merged

allisonmahmood merged 3 commits into
mainfrom
docs/788-rollback-answers

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

What changed

Production deploys are frequent now, and migrations never roll back. Nothing on a PR or at a deploy says whether rolling back past a change is safe, so it gets found out during an incident.

  • PR template. Release impact asks two questions beside Breaking: what a revert leaves behind, and whether the release before it still works with that.
  • one-way label. It marks a PR whose second answer is no. It's documented in docs/agents/triage-labels.md and created on GitHub.
  • AGENTS.md › Deploying.
    • The deploying agent pins the live commit from /healthz/deep. It stops if any Deploy run hasn't finished, or the one updated last didn't succeed, and checks again before dispatching.
    • It reviews rollback safety across live..deploy, which is separate from the What's new range.
    • It dispatches the exact reviewed commit with -f revision=<sha>.
    • It ends the docs(whats-new) PR and the hand-off with one rollback line.
    • Step 5 still merges the What's new PR once it's green.
  • OPERATIONS › Deploying names the rollback line and the pinned revision beside the runbook.

Closes #788

How it was verified

This is docs, a template and a label, so there are no tests. Prettier passes on the changed files.

The dispatch, checked by reading. deploy.yml sets COMMIT to inputs.revision || github.sha and checks that commit out. It refuses anything that isn't a full sha on main. Step 4 then builds the server image from that commit. Deploy never uses server-image.yml's artifact, so a sha whose main CI hasn't finished still deploys. There is no "image not built yet" case. ECR tags are immutable: a commit that was pushed before must rebuild to the same digest, or the run fails. /healthz/deep reports the same revision the app stack was given.

Steps 1 and 3, dry run against production today. This was a public GET only, with no dispatch.

$ curl -s https://cloud.patchyhq.com/healthz/deep | jq -r .revision
03891e4d3361cdb70bdb5c48d632700b612e48b7
$ gh run list --workflow deploy.yml --limit 1000 --json status,conclusion,updatedAt,url --jq 'sort_by(.updatedAt) | last, (.[] | select(.status != "completed"))'
{"conclusion":"success","status":"completed","updatedAt":"2026-10-19T01:13:01Z","url":"https://github.com/allisonmahmood/patchy-cloud/actions/runs/39182309291"}
$ git log --first-parent --format='%h %s' 03891e4..origin/main
6900c71 feat(patchy): agents read a published patch's log with `patchy logs` (#786)
$ gh pr view 786 --json labels -q '[.labels[].name] | join(",")'
area:server,area:ci,area:cli,area:docs,area:ui,size:xl
$ git show 03891e4:packages/core/src/whatsNew.ts | grep -m1 'id:'
    id: 14,

#786 has no answers because it predates the questions, so I read its diff. It adds a route and a CLI command, with no migration. Release 14 would answer the new route with a 404 and keep working. Today's line would be: "If this release misbehaves, roll back to 03891e4 (release 14)."

What can only be shown after merge. GitHub serves the template from main, so the first PR to carry both questions will be one opened after this merges. This PR answers them by hand below. The next deploy will be the first one dispatched with an exact revision, and the first whose hand-off names a rollback commit or boundary.

Release impact

  • Breaking — requires action from anyone already running this

  • Not breaking — docs, the PR template and a GitHub label

  • What does a revert leave behind? The one-way label on GitHub, and any answers PRs have already written. Nothing in production.

  • Does the release before it still work with that? Yes. Nothing here ships to production.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:s Under 100 changed lines labels Oct 19, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review round 1 (GPT 6.1 Sol, xhigh)

One blocking finding, now fixed in 9f7bdaf:

  • The deploy gate could miss a running Deploy run. gh run list --limit 1 sorts by creation. A rollback by re-running an older run (OPERATIONS › Rolling back) kept that run's old place, hidden behind a newer success. A run could also start during the review. Step 1 now sorts by update and lists every unfinished run. Step 6 repeats the check before dispatching, and an unsettled run means stop, settle, then pin and review again.

Sol found nothing else: the dispatch reading, the template, the label section and the "after merge" note all held up.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review round 2 (GPT 6.1 Sol, xhigh)

Nothing blocking. Sol checked the round 1 fix against GitHub's behaviour: a re-run updates updatedAt and reports its current attempt's status, a run waiting for approval counts as unfinished, and step 6 repeats the check. The command returns one completed, successful run and no unfinished ones today.

One non-blocking note, fixed: --limit 100 cuts the list before it's sorted. GitHub only allows re-runs within 30 days of a run, so this would take more than 100 Deploy runs in 30 days. The limit is now 1000 anyway; the query still takes about a second.

allisonmahmood and others added 3 commits October 19, 2026 15:11
Every PR answers what a revert leaves behind and whether the release
before it still works with that, in the template's Release impact
section. A `one-way` label marks the ones that can't be rolled back
past.

A deploy now pins the live commit from /healthz/deep, stops while a
Deploy run is unfinished or failed, reviews rollback safety across
live..deploy, dispatches the exact reviewed commit, and ends with one
rollback line.

Closes #788

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e dispatch

`gh run list --limit 1` sorts by creation, so an older run re-run for a
rollback was invisible behind a newer success. Sort by update instead,
list every unfinished run, and repeat the check before dispatching.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the docs/788-rollback-answers branch from b658666 to c7f6854 Compare October 19, 2026 13:11
@allisonmahmood
allisonmahmood merged commit 3c22af2 into main Oct 19, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the docs/788-rollback-answers branch October 19, 2026 13:21
allisonmahmood added a commit that referenced this pull request Oct 19, 2026
…connection (#814)

Release 15's What's new entry, written from `9e4b0df`. It covers
everything merged since release 14's `through` (`7694bab`), and sets the
`patchy` release to `0.15.0` (`packages/patchy/package.json` and
`CURRENT_RELEASE`).

| Change | PRs |
| --- | --- |
| New: Your agent can read a tool's log | #786 |
| Fixed: Tools with server code keep one steady connection | #798 |
| Behind the scenes: an unused open tool lets its server rest | #802 |

#783 is release 14's own entry, so it's left out. #795, #796, #797,
#799, #803, #804, #806 and #807 are agent docs, CI and dev tooling, with
no line.

None of the PRs in the range are `one-way`; #786 and #798 predate the
rollback questions, and their diffs leave nothing an older release can't
run with (a new read-only route and CLI command, and the load balancer's
stickiness setting, which the older commit restores).

If this release misbehaves, roll back to `03891e4` (release 14).

Made by Claude Opus 5.5 via Claude Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PRs and deploys say whether a rollback is safe

1 participant