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

scout/forge:scout/5778-the-openapi-document-describes-mirroring → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/5778-the-openapi-document-describes-mirroring was merged into main as 9ed8ae5.

Review

Sign in to review this change.
2 files changed +19 −4
src/contract/openapi.ts +19
@@ -857,6 +857,25 @@ export const ROUTES: readonly Route[] = [
857857 auth: true,
858858 refusals: { not_found: "404: no such origin or job of yours" },
859859 },
860 {
861 method: "post",
862 path: `${BROWSE}/contribute`,
863 summary:
864 "Contribute to a repository you only browse (admin scope): fork it if you cannot push, branch, commit files and optionally open a pull upstream; answers 201 with the contribution",
865 auth: true,
866 status: 201,
867 body: { branch: "string", base: "string", message: "string", files: "array", openPull: "object" },
868 refusals: {
869 not_found: "404: no such origin of yours, or no such repository there",
870 unverified: "403: prove your email first",
871 origin_unreachable: "422: the origin could not be reached",
872 invalid_branch: "422: that branch is not one this forge can use",
873 unknown_base: "422: that base branch is not one this forge can use",
874 fork_timeout: "504: the origin took the fork and it has not appeared yet; try again shortly",
875 mirror_failed: "502: a local copy of the repository could not be made",
876 pull_failed: "422: the commit landed but the pull did not open; { reason, commit }",

Non-blocking: edit_failed passes through editFailure, so this route can also answer branch_moved (409), file_too_large / commit_too_large (413) and protected_branch (403). Those refusals aren't listed here. A later pull could add them once the openapi.ts freeze lifts.

877 },
878 },
860879 { method: "get", path: "/api/v1/user/origin-apps", summary: "List your registered OAuth applications, one per origin host", auth: true },
861880 {
862881 method: "post",
test/openapi-coverage.test.ts −4
@@ -70,7 +70,6 @@ const NOT_YET_DESCRIBED: readonly string[] = [
7070 "GET /api/v1/user/origins/{}/browse/{}/{}/tags",
7171 "GET /api/v1/user/origins/{}/browse/{}/{}/tree/{}",
7272 "GET /api/v1/user/origins/{}/browse/{}/{}/tree/{}/{}",
73 "GET /api/v1/user/origins/{}/mirror/{}",
7473 "GET /api/v1/user/origins/{}/mirror/{}/stream",
7574 "GET /api/v1/user/origins/{}/repos",
7675 "GET /api/v1/user/pins",
@@ -109,9 +108,6 @@ const NOT_YET_DESCRIBED: readonly string[] = [
109108 "POST /api/v1/user/origin-apps",
110109 "POST /api/v1/user/origins",
111110 "POST /api/v1/user/origins/oauth",
112 "POST /api/v1/user/origins/{}/browse/{}/{}/contribute",
113 "POST /api/v1/user/origins/{}/fork",
114 "POST /api/v1/user/origins/{}/mirror",
115111 "POST /api/v1/user/origins/{}/sync",
116112 "PUT /api/v1/admin/capacity/{}",
117113 "PUT /api/v1/admin/limits/{}",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs