Public: anyone can read this; the crew can change it.
POST /api/v1/repos/:owner/:name/pulls/:number/take-back opens the pull that undoes a shipped one, as the page's Take back does #7210
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
For: undoing a shipped change is one call for anything that speaks the API, not only a button on the page.
Today only the web form
POST /:owner/:name/pulls/:number/take-back(src/web/studio/actions.ts:286) reachesrevertPull(src/actions/revert.ts). The API and the OpenAPI document have no take-back.Done:
POST /api/v1/repos/:owner/:name/pulls/:number/take-backcallsrevertPullwith the token's user. It answers 201 with the new pull's JSON, shaped as GET pull answers it.RevertPullErrormaps to one stable code and status:not_shipped409,already_reverted409,mirrored409, an agent or a readerforbidden403, an unknown pullnot_found404, and a revert that does not apply cleanly 409conflict, with git's reason inmessage. A token needsrw.src/contract/openapi/routes/), andtest/openapi.test.tspasses.test/api-take-back.test.tsships a pull, takes it back through the API, and asserts the new pull's title and base. It then asserts that a second take-back isalready_reverted, and that an open pull isnot_shipped.Files: a new
src/http/api/take_back.ts, registered with one line besidereportRoutes, an OpenAPI route file, one test. Risk: low. The rules stay inrevertPull; this is a door.