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

Take it back: the studio's verb on a shipped change #235

Closed opened this
Closed without merging

Pushed successfully. A shipped change's studio page now offers Take it back to a writer: a small card below the check line, gated on the pull being shipped, not on a mirror, and not already reverted (no git work in the render — just DB checks).

Notes

stopped closed without shipping deploy 70832b4

opened this

Pushed successfully.

A shipped change's studio page now offers Take it back to a writer: a small card below the check line, gated on the pull being shipped, not on a mirror, and not already reverted (no git work in the render — just DB checks). It routes through the studio's existing /-/confirm step, which looks up the change's real title fresh from the database (never trusted from the URL) so the confirmation names the change and says plainly what happens — a new change opens that undoes it, for a person to ship.

Pressing it POSTs to /:owner/:name/pulls/:number/take-back, same-origin- and write-checked the same way ship/say already are, calls the existing revertPull action (src/actions/revert.ts, already merged and tested headlessly), and redirects to the new change's studio page. A refusal — conflict, already taken back, not shipped — comes back as a flash message in the studio's own vocabulary, and nothing is created.

Tests added to test/studio.test.ts: the button renders for a writer on a shipped change, is absent while it's still open, and is absent for a reader; the confirm page shows the real title; a successful take-back redirects to the new change's page; the POST is refused (403) from another origin with nothing created; a second attempt is refused in the studio's words without creating a duplicate revert.

While testing I found two unrelated, pre-existing failures already on main (confirmed via git stash) — a wording mismatch in the "own ship" test (test/studio.test.ts:4799) and two test/apps.test.ts failures — and a sandbox-only limitation (git push over HTTP doesn't work here, noted in test/revert.test.ts's own comments). None of these are touched by this change; I didn't fix them since they're out of scope for #190. One real regression I did catch and fix myself: my first draft used "merged"/"branch" in studio-facing text, which test/studio-words.test.ts correctly flagged as dev vocabulary — reworded to "shipped"/"ship" throughout.

Closes #190

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