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

The OpenAPI document describes a repository's waves: the list and one wave #5763

Merged opened this

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

Merged

scout/forge:scout/5364-the-openapi-document-describes-a-reposit → main 1 commit fork

  • Merged. scout/5364-the-openapi-document-describes-a-reposit was merged into main as 7e2fe8e.

Review

Sign in to review this change.
3 files changed +19 −2
src/contract/openapi.ts +2
@@ -332,6 +332,8 @@ export const ROUTES: readonly Route[] = [
332332 { method: "get", path: `${REPO}/labels`, summary: "List a repository's labels by name as a bare array of { id, name, color }; a private repository needs a token", auth: false },
333333 { method: "get", path: `${REPO}/milestones`, summary: "Read the plan: { repo: { owner, name }, limbs }, one limb per milestone with its weights (and askToLive for a pillar's umbrella); a private repository needs a token", auth: false },
334334 { method: "get", path: `${REPO}/milestones/{number}`, summary: "Read one milestone (a 404 for an issue that waits for nothing) as { repo, ...milestone, askToLive?, watching? }; watching is present only for a signed-in user; a private repository needs a token", auth: false },
335 { method: "get", path: `${REPO}/waves`, summary: "List what shipped, newest first, as { items: [{ version, date, headline }], next_cursor: null }; a file that is not a wave is left out; a private repository needs a token", auth: false, reply: { items: "array", next_cursor: "null" }, refusals: { not_found: "404: no such repository, or it is not readable" } },
336 { method: "get", path: `${REPO}/waves/{version}`, summary: "Read one wave as { version, date, headline, highlights, pulls: [{ number, title, url }] }; number is null when the line names no pull; a private repository needs a token", auth: false, reply: { version: "string", date: "string", headline: "string", highlights: "array", pulls: "array" }, refusals: { not_found: "404: no such repository, or it is not readable, or no such wave" } },
335337 {
336338 method: "post",
337339 path: `${REPO}/issues`,
test/openapi-coverage.test.ts −2
@@ -47,8 +47,6 @@ const NOT_YET_DESCRIBED: readonly string[] = [
4747 "GET /api/v1/repos/{}/{}/pulls/{}/review-states",
4848 "GET /api/v1/repos/{}/{}/pulls/{}/reviews",
4949 "GET /api/v1/repos/{}/{}/reports",
50 "GET /api/v1/repos/{}/{}/waves",
51 "GET /api/v1/repos/{}/{}/waves/{}",
5250 "GET /api/v1/user",
5351 "GET /api/v1/user/assigned",
5452 "GET /api/v1/user/keys",
test/openapi-oa-waves.test.ts added +17
@@ -0,0 +1,17 @@
1 /** The OpenAPI document describes a repository's waves: the list and one wave. */
2 import { expect, test } from "bun:test";
3 import { openapi } from "../src/contract/openapi.ts";
4
5 const R = "/api/v1/repos/{owner}/{name}";
6
7 test("the waves list and one wave are in the served document with their 404", () => {
8 const doc = openapi("https://f.test", "1") as any;
9 const list = doc.paths[`${R}/waves`]?.get;
10 const one = doc.paths[`${R}/waves/{version}`]?.get;
11 expect(list).toBeDefined();
12 expect(one).toBeDefined();
13 expect(list.security).toBeUndefined();
14 expect(one.security).toBeUndefined();
15 expect(list.responses.default.description).toContain("`not_found`");
16 expect(one.responses.default.description).toContain("no such wave");
17 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs