Public: anyone can read this; the crew can change it.
The OpenAPI document describes editing a pull, its reviews, approving it here and assigning an issue or pull #5261
Check · Review · Land · Live done — Landed and live in production.
The OpenAPI document now has rows for editing a pull, listing and posting reviews, approving here, and assigning an issue or a pull. The openapi tests (13 files, 29 tests) and the type check pass, and I pushed the branch. I did not run the full `bun test`.
shipped production is serving it deploy c48dffd
The OpenAPI document now has rows for editing a pull, listing and posting reviews, approving here, and assigning an issue or a pull. The openapi tests (13 files, 29 tests) and the type check pass, and I pushed the branch. I did not run the full bun test.
- Rows added in
src/contract/openapi.ts: each sits beside its neighbours by path and gives the summary, auth, body fields, success status and refusal codes the handler answers.
- PATCH {REPO}/pulls/{number} takes title, body and state. Its refusals are invalid_text, invalid_state, invalid_reason and nothing_to_change.
- GET …/pulls/{number}/reviews is new and has no refusals.
- POST …/pulls/{number}/reviews already had a row, but it described a verdict body. The handler actually takes a single-line comment (path, line, side, body), answers 201 and refuses with bad_anchor, so I rewrote it. Verdicts go to …/review-states, which this issue does not cover.
- POST …/pulls/{number}/approve-here answers 201. Its refusals are not_foreign, self_review and not_open.
- PUT …/issues/{number}/assignee and PUT …/pulls/{number}/assignee take assignee, a username or null. Both refuse with invalid_assignee and no_such_user.
- New
test/openapi-pulls.test.ts: it asserts all six path and method pairs are in the document. It also boots an app and checks one refusal per row against the live route:invalid_state,bad_anchor,not_foreignandno_such_user(for both assignee routes). - One edit to
test/openapi.test.ts: its "every described route is registered" check reads route registrations as literal strings, so it couldn't see the assignee routes, whichapi.tsregisters in a loop overissuesandpulls. I made it expand that loop into two routes. The check itself is unchanged.
Not covered:
- The routes themselves are unchanged.
- The
self_review,not_open,invalid_text,invalid_reason,nothing_to_changeandinvalid_assigneerefusals are documented but not exercised by a test.
Try it with bun test test/openapi, or fetch GET /contract/openapi.json and look for the six entries.
🤖 Generated with Claude Code
The six rows match the handlers I read (PATCH pull, GET/POST reviews, approve-here 201 with its three refusals, both assignee PUTs). The preview serves the document. Tests cover the paths and one refusal per row, and the openapi.test loop expansion is a fair fix. Two things next: (1) test the documented refusals that are still unexercised (self_review, not_open, invalid_text, invalid_reason, nothing_to_change, invalid_assignee); (2) document the PATCH pull reason/into body fields the invalid_reason row mentions, or drop that row if a pull never takes them.
The OpenAPI document now has rows for editing a pull, listing and posting reviews, approving here, and assigning an issue or a pull. The openapi tests (13 files, 29 tests) and the type check pass, and I pushed the branch. I did not run the full
bun test.src/contract/openapi.ts: each sits beside its neighbours by path and gives the summary, auth, body fields, success status and refusal codes the handler answers.-
PATCH {REPO}/pulls/{number}takestitle,bodyandstate. Its refusals areinvalid_text,invalid_state,invalid_reasonandnothing_to_change. -GET …/pulls/{number}/reviewsis new and has no refusals. -POST …/pulls/{number}/reviewsalready had a row, but it described averdictbody. The handler actually takes a single-line comment (path,line,side,body), answers 201 and refuses withbad_anchor, so I rewrote it. Verdicts go to…/review-states, which this issue does not cover. -POST …/pulls/{number}/approve-hereanswers 201. Its refusals arenot_foreign,self_reviewandnot_open. -PUT …/issues/{number}/assigneeandPUT …/pulls/{number}/assigneetakeassignee, a username or null. Both refuse withinvalid_assigneeandno_such_user.test/openapi-pulls.test.ts: it asserts all six path and method pairs are in the document. It also boots an app and checks one refusal per row against the live route:invalid_state,bad_anchor,not_foreignandno_such_user(for both assignee routes).test/openapi.test.ts: its "every described route is registered" check reads route registrations as literal strings, so it couldn't see the assignee routes, whichapi.tsregisters in a loop overissuesandpulls. I made it expand that loop into two routes. The check itself is unchanged.Not covered:
self_review,not_open,invalid_text,invalid_reason,nothing_to_changeandinvalid_assigneerefusals are documented but not exercised by a test.Try it with
bun test test/openapi, or fetchGET /contract/openapi.jsonand look for the six entries.🤖 Generated with Claude Code
Closes #5241