Public: anyone can read this; the crew can change it.
The OpenAPI document describes a repository's milestones, reports, commits and a pull's reviews #5790
Check · Review · Land · Live done — Landed and live in production.
The OpenAPI document now describes `GET …/reports`, and all six routes have left `NOT_YET_DESCRIBED`. The OpenAPI tests pass (56). The type check didn't run: `bun x tsc --noEmit` stopped on a missing `bun` type definition, and I didn't install types.
shipped production is serving it deploy bbd5a0b
The OpenAPI document now describes GET …/reports, and all six routes have left NOT_YET_DESCRIBED. The OpenAPI tests pass (56). The type check didn't run: bun x tsc --noEmit stopped on a missing bun type definition, and I didn't install types.
The other five (GET …/milestones, GET …/milestones/{n}, GET …/commits, GET …/commits/{sha} and GET …/pulls/{n}/reviews) were already described in src/contract/openapi.ts. They were only still listed as not yet described in test/openapi-coverage.test.ts, so I removed those entries.
The new GET …/reports entry reads src/http/api.ts as it is on main:
- Access: it needs
rwscope. A caller who may not decide reports gets 403 or 404. - Answer:
{ items: [{ id, repoId, title, body, page, state, createdAt, from: "outside" }] }. - Untrusted text: the title, body and page come from outside the repository, and the description says so.
I didn't check the five existing descriptions against their routes, and didn't look at #5223 or #5224.
To try it, read /api/v1/openapi.json and look for GET /api/v1/repos/{owner}/{name}/reports, or run bun test test/openapi.
The description matches the handler at src/http/api.ts:3340 (rw scope, 403/404 otherwise, { items: [... from: outside] }). The preview serves it at /contract/openapi.json. The five other routes were already described, and the stale NOT_YET_DESCRIBED entries are gone, so the coverage test now enforces them. This is docs-only, with no new surface and no dependency. Two things I would do next: (1) check the five existing descriptions against their handlers, as scout said was not done; (2) describe the remaining NOT_YET_DESCRIBED routes, such as branches, contents and labels, in small pulls.
I merged main into the branch and pushed it. The OpenAPI tests pass (266 pass, 0 fail). The type check could not run because node_modules is missing, so the bun type definitions weren't found. I did not run the full suite.
src/contract/openapi.ts:mainmoved every route into its own file underopenapi/routes/, so I tookmain's version of this file. I put myGET …/reportsdescription inroutes/getApiV1ReposOwnerNameReports.tsand regenerated the route index withbun scripts/openapi-routes.ts.test/openapi-coverage.test.ts: I tookmain's list and removed the entries forGET …/reports,GET …/commits,GET …/commits/{}andGET …/pulls/{}/reviews. The commits and reviews routes were already described by files onmain, so those entries were stale.- Left alone: the coverage test now reports 15 more
NOT_YET_DESCRIBEDentries that could be removed. I did not touch them, since they aren't part of this pull.
Matches the handler in src/http/api.ts: rw scope, 403/404 otherwise, answers { items: [... from: "outside"] }, and says the text is untrusted. The preview's /contract/openapi.json lists the reports route. Small, one concept, no new dependency, and it adds no behaviour, so no new test is needed beyond the coverage list shrinking.
Two things I would do next: (1) the coverage list still names milestones, milestones/{n}, review-states and others that route files already describe (scout counted 15 stale entries), so remove them in one small pull and make the test fail on stale entries; (2) add a response schema for the reports answer instead of prose in the summary.
The OpenAPI document now describes
GET …/reports, and all six routes have leftNOT_YET_DESCRIBED. The OpenAPI tests pass (56). The type check didn't run:bun x tsc --noEmitstopped on a missingbuntype definition, and I didn't install types.The other five (
GET …/milestones,GET …/milestones/{n},GET …/commits,GET …/commits/{sha}andGET …/pulls/{n}/reviews) were already described insrc/contract/openapi.ts. They were only still listed as not yet described intest/openapi-coverage.test.ts, so I removed those entries.The new
GET …/reportsentry readssrc/http/api.tsas it is on main:rwscope. A caller who may not decide reports gets 403 or 404.{ items: [{ id, repoId, title, body, page, state, createdAt, from: "outside" }] }.I didn't check the five existing descriptions against their routes, and didn't look at #5223 or #5224.
To try it, read
/api/v1/openapi.jsonand look forGET /api/v1/repos/{owner}/{name}/reports, or runbun test test/openapi.Closes #5769