Public: anyone can read this; the crew can change it.
Take it back: the studio's verb on a shipped change #235
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).
stopped closed without shipping deploy 70832b4
Sign in to join this conversation.
new above
offline
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
/-/confirmstep, 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 wayship/sayalready are, calls the existingrevertPullaction (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 viagit stash) — a wording mismatch in the "own ship" test (test/studio.test.ts:4799) and twotest/apps.test.tsfailures — and a sandbox-only limitation (git pushover HTTP doesn't work here, noted intest/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, whichtest/studio-words.test.tscorrectly flagged as dev vocabulary — reworded to "shipped"/"ship" throughout.Closes #190