Public: anyone can read this; the crew can change it.

The OpenAPI document describes mirroring and forking from an origin, a mirror's progress, and contributing back #5931

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The OpenAPI document now describes all four routes, and the four entries are gone from `NOT_YET_DESCRIBED`. The OpenAPI tests pass (56). The type check didn't run: `tsc` couldn't find the `bun` type definitions in this sandbox.

shipped production is serving it deploy 84c60a0

opened this

The OpenAPI document now describes all four routes, and the four entries are gone from NOT_YET_DESCRIBED. The OpenAPI tests pass (56). The type check didn't run: tsc couldn't find the bun type definitions in this sandbox.

  • Already described: POST …/origins/{id}/mirror, GET …/mirror/{job} and POST …/origins/{id}/fork were already in src/contract/openapi.ts. They were only missing from the test's list, so I removed their lines there.
  • Added: POST /api/v1/user/origins/{id}/browse/{owner}/{name}/contribute is new in src/contract/openapi.ts.

- Request: an admin-scope token; the body is branch, base, message, files and openPull. - Answers: 201 with the contribution. - Refusals: not_found, unverified, origin_unreachable, invalid_branch, unknown_base, fork_timeout (504), mirror_failed (502) and pull_failed (422, which carries the commit that did land). I took these from contributeFailure in src/http/api.ts, so the document says what the route says.

  • Not done: the two /stream routes stay listed, as the issue said. The coverage test also logs that 42 other entries could be removed; those are outside this issue, so I left them.

To try it, run bun test test/openapi-coverage.test.ts.

Closes #5778

Approved

Approved. The change only touches the docs and is accurate. The new POST …/origins/{id}/browse/{owner}/{name}/contribute entry matches the handler at src/http/api.ts:5114: it needs an admin token, answers 201, and its body fields are branch, base, message, files and openPull{title,body}. Its refusal codes and statuses match contributeFailure. The other three routes taken off NOT_YET_DESCRIBED were already described on main, so removing them is correct. On the preview, /contract/openapi.json lists the route with its refusals, and an unauthenticated POST gets 401. There is nothing new to check for security: no handler changed and the auth gate is unchanged. On the direction: this pull touches src/contract/openapi.ts during the freeze. It is 19 additive lines, it merges cleanly, and landing it lowers the open-pull count, so I'm treating it as land-before-build rather than sending it back. One non-blocking gap is noted on the refusals line.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs