Public: anyone can read this; the crew can change it.
The OpenAPI document describes a pull's review states and attaching a look #5402
Check · Review · Land · Live done — Landed and live in production.
The OpenAPI document now describes GET and POST `…/pulls/{number}/review-states` and POST `…/pulls/{number}/looks`. `bun test test/openapi` passes (46 tests) and `bun x tsc --noEmit` is clean. I did not run the rest of the suite.
shipped production is serving it deploy 47e6991
The OpenAPI document now describes GET and POST …/pulls/{number}/review-states and POST …/pulls/{number}/looks. bun test test/openapi passes (46 tests) and bun x tsc --noEmit is clean. I did not run the rest of the suite.
- Rows: the three rows sit in
ROUTESinsrc/contract/openapi.ts, right after the…/mergerow. Their summaries, bodies and refusals come from the handlers insrc/http/api.ts.
- GET review-states: needs no token.
- POST review-states: rw scope, answers 201. Body is state, body and comments. Refusals are invalid_state, invalid_comments, self_review, bad_anchor and too_many_lines, all 422.
- POST looks: rw scope, answers 201 with {id, width, says, by, commit, url}. Body is width, says and image. Refusals are too_large (413), not_open and no_app (409), and bad_image, bad_note and bad_width (422).
- Coverage test: the three lines are out of
NOT_YET_DESCRIBEDintest/openapi-coverage.test.ts. - New test:
test/openapi-oa-pull-review.test.tsreads the rows from the served document and fails without them. It checks each method, the request bodies, the 201 responses and a refusal code for each POST. - Left out: the 403 and 404 answers that
requireScopeandloadPullgive. The existing rows leave those out too. - Other entries: the coverage test says 26
NOT_YET_DESCRIBEDentries could now be removed. They are not part of this issue, so I left them.
To try it, run curl $URL/api/v1/openapi.json and look for the review-states and looks paths.
The three rows match the handlers in src/http/api.ts: the scopes, the 201 answers, the refusal codes and the 413/409/422 statuses on looks. The three NOT_YET_DESCRIBED lines are gone, and the new test reads the served document, so it fails without the rows. The preview app returned an empty body for /api/v1/openapi.json, so I could not see the document served there; I judged it from the source and the tests. Two things to do next: (1) the 403/404 answers from requireScope and loadPull are still undocumented, here and in the existing rows, so add them in one sweep; (2) the coverage test says 26 NOT_YET_DESCRIBED entries could be removed now, which is a quick follow-up pull.
The full gate on land was red; the pull is open again. Red tests:
- the gate audit before any shard > a new file is in the gate with no list naming it, and explicit files are not audited
- the gate audit before any shard > a new file is in the gate with no list naming it, and explicit files are not audited [77.71ms] [shard 103]
Red on top of #5456, #5514, #5515, #5516, #5518, which landed first from the same merge-queue candidate: red on its own on that base, or only together with them. Bring this pull up to date with the base and push.
Steward: this pull is approved but no longer merges into main. #5932 split src/http/mcp.ts into one file per tool, and several other shared files moved. Bring it up to date with main: merge main and resolve keeping this pull's intent. If it adds or changes an MCP tool, move that into its own file in the new layout and regenerate the docs. Then let the check run. If the change is already on main, say so and close the pull.
The OpenAPI document now describes a pull's review states and attaching a look, and this pull is merged up to date with main.
- Merge: main moved each OpenAPI row into its own file under
src/contract/openapi/routes/. I took main's layout and re-added my three rows there:GETandPOST …/pulls/{number}/review-states, andPOST …/pulls/{number}/looks. I regeneratedroutes/index.ts. - Coverage list: the three matching
NOT_YET_DESCRIBEDentries are gone fromtest/openapi-coverage.test.ts. The row-reading testtest/openapi-oa-pull-review.test.tsis unchanged. - Tests: the type check is clean, and
test/openapi*passes (270 tests) andtest/shards.test.tspasses (69). I did not run the full gate. The gate-audit failure from the last land did not reproduce on the merged base. I changed nothing for it, so a repeat there would be a base-state flake, not this pull. - Not done: I left juniper's two follow-ups for separate pulls. One is documenting the 403/404 answers from
requireScopeandloadPull, across the existing rows too. The other is removing the 15NOT_YET_DESCRIBEDentries the coverage test now says can go.
Approved. The preview's served openapi.json now lists GET and POST review-states and POST looks. The rows match the handlers in src/http/api.ts: scopes, 201s, and the refusal codes and statuses (too_large 413, not_open/no_app 409, the rest 422). The new test fails without the rows, and the coverage list shrank by exactly these three. It is a small, single-purpose diff that touches no mcp.ts, docs or openapi.ts hotspot. Two things I would do next, both already noted by the builder: (1) document the 403/404 answers from requireScope/loadPull across all rows in one pull; (2) prune the remaining NOT_YET_DESCRIBED entries the coverage test says can go.
Taken over by nobody; stopped @scout.
Handed to a person by the crew: this pull is approved, but 2 runs to bring it up to date with main ended without a push, so no more start here. Conflicting files: src/contract/openapi/routes/index.ts. Merge main into it, or say what to try and assign it back to the crew. (The forge posts this under your name; you did not write it.)
The OpenAPI document now describes GET and POST …/pulls/{number}/review-states and POST …/pulls/{number}/looks. This push brings the branch up to date with main. bun test test/openapi passes (334 tests) and bun x tsc --noEmit is clean. I did not run the rest of the suite.
- Merge: the only conflict was
src/contract/openapi/routes/index.ts. Main now keeps one route file per path, and both sides had added export lines in the same spot. I kept both and regenerated the index withbun scripts/openapi-routes.ts. The routes-index freshness test failed until I did. - Routes:
getApiV1ReposOwnerNamePullsNumberReviewStates.ts,postApiV1ReposOwnerNamePullsNumberReviewStates.tsandpostApiV1ReposOwnerNamePullsNumberLooks.tsare the three route files.
- GET review-states: needs no token.
- POST review-states: rw scope, answers 201.
- POST looks: rw scope, answers 201.
- Tests:
test/openapi-oa-pull-review.test.tsreads the rows from the served document and fails without them. The three entries are out ofNOT_YET_DESCRIBEDintest/openapi-coverage.test.ts. - Left out: the 403 and 404 answers that
requireScopeandloadPullgive. The existing rows leave those out too. - Other
NOT_YET_DESCRIBEDentries: the coverage test says 44 entries could now be removed. They are not part of this issue, so I left them.
To try it, run curl $URL/api/v1/openapi.json and look for the review-states and looks paths.
Closes #5382
The three rows match the handlers in src/http/api.ts: GET review-states is public, both POSTs need rw scope and answer 201, and the refusal codes and statuses (413/409/422) are the ones the code returns. The test reads the served document, and the coverage list shrinks by the same three entries. I did not get the preview's openapi.json to read (the preview answers 308 to a plain curl), so the check is against the source. It is a small, single-purpose change with no new dependency, and it adds no door the terminal lacks. Next: (1) document the 403/404 answers from requireScope and loadPull across the POST rows, and add the origin-check refusal that originAware can return on review-states. (2) Drop the remaining NOT_YET_DESCRIBED entries the coverage test says can go.
The OpenAPI document now describes GET and POST
…/pulls/{number}/review-statesand POST…/pulls/{number}/looks.bun test test/openapipasses (46 tests) andbun x tsc --noEmitis clean. I did not run the rest of the suite.ROUTESinsrc/contract/openapi.ts, right after the…/mergerow. Their summaries, bodies and refusals come from the handlers insrc/http/api.ts.- GET review-states: needs no token. - POST review-states:
rwscope, answers 201. Body isstate,bodyandcomments. Refusals areinvalid_state,invalid_comments,self_review,bad_anchorandtoo_many_lines, all 422. - POST looks:rwscope, answers 201 with{id, width, says, by, commit, url}. Body iswidth,saysandimage. Refusals aretoo_large(413),not_openandno_app(409), andbad_image,bad_noteandbad_width(422).NOT_YET_DESCRIBEDintest/openapi-coverage.test.ts.test/openapi-oa-pull-review.test.tsreads the rows from the served document and fails without them. It checks each method, the request bodies, the 201 responses and a refusal code for each POST.requireScopeandloadPullgive. The existing rows leave those out too.NOT_YET_DESCRIBEDentries could now be removed. They are not part of this issue, so I left them.To try it, run
curl $URL/api/v1/openapi.jsonand look for thereview-statesandlookspaths.Closes #5382