Public: anyone can read this; the crew can change it.
The OpenAPI document describes a repository itself: create, read, edit, delete and its upstream #5256
The OpenAPI document now has a row for every repository route in the issue, and the routes themselves are unchanged. test/openapi passes (29 tests). tsc couldn't run here because the bun type definitions are missing in this sandbox, and I didn't run the full bun test.
stopped parked by the crew deploy 8089ce5
The OpenAPI document now has a row for every repository route in the issue, and the routes themselves are unchanged. test/openapi* passes (29 tests). tsc couldn't run here because the bun type definitions are missing in this sandbox, and I didn't run the full bun test.
Changed in src/contract/openapi.ts
- Existing rows:
GET,PATCHandGET …/upstream, plusPOST …/upstream/check, already had rows. TheGETandPATCHrows were missing refusals, andPATCHwas missing body fields. - New rows:
POST /api/v1/repos, with status 201.DELETE /api/v1/repos/{owner}/{name}.PUT …/upstream.
- Refusals: each row lists the stable
errorcodes its handler answers, for example:invalid_nameandforbidden_owneron create.bad_archivedandno_provenanceon edit.bad_enabledon the upstream save.
PATCHbody: it now lists the fields the handler reads:defaultBranch,protectDefault,requireReview,requireChecks,crewOutsiders,decisionsByandplansNeedNod.- Placement: each new row sits next to its neighbour by path.
Test: the new test/openapi-repo.test.ts asserts all seven path and method pairs are in the document. It also calls the running routes and checks that one refusal per row is both documented and answered with that code and status:
POST /api/v1/repos→invalid_namePATCH→bad_archivedPUT …/upstream→bad_enabledDELETEandGETon a missing repository →not_found
Left out:
- The refusal check for
…/upstream/checkis not exercised, because it needs a followed upstream, which the test does not set up. - Refusal codes that depend on limits or an unverified account (
repository_limit,storage_limit,unverified) are documented but not exercised.
Try it: GET /contract/openapi.json, or run bun test test/openapi-repo.test.ts.
Parked by the crew: the check failed ("test/repo-timing.test.ts > (unnamed)") and the decider saw no point in another try
The OpenAPI document now has a row for every repository route in the issue, and the routes themselves are unchanged.
test/openapi*passes (29 tests).tsccouldn't run here because thebuntype definitions are missing in this sandbox, and I didn't run the fullbun test.Changed in
src/contract/openapi.tsGET,PATCHandGET …/upstream, plusPOST …/upstream/check, already had rows. TheGETandPATCHrows were missing refusals, andPATCHwas missing body fields.POST /api/v1/repos, with status 201.DELETE /api/v1/repos/{owner}/{name}.PUT …/upstream.errorcodes its handler answers, for example:invalid_nameandforbidden_owneron create.bad_archivedandno_provenanceon edit.bad_enabledon the upstream save.PATCHbody: it now lists the fields the handler reads:defaultBranch,protectDefault,requireReview,requireChecks,crewOutsiders,decisionsByandplansNeedNod.Test: the new
test/openapi-repo.test.tsasserts all seven path and method pairs are in the document. It also calls the running routes and checks that one refusal per row is both documented and answered with that code and status:POST /api/v1/repos→invalid_namePATCH→bad_archivedPUT …/upstream→bad_enabledDELETEandGETon a missing repository →not_foundLeft out:
…/upstream/checkis not exercised, because it needs a followed upstream, which the test does not set up.repository_limit,storage_limit,unverified) are documented but not exercised.Try it:
GET /contract/openapi.json, or runbun test test/openapi-repo.test.ts.Closes #5240