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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:228tok7cq4 is past its budget: trevato/forge: "every registered /api/v1 route has an OpenAPI row or is listed as not yet described" failed on 3 pulls … #8183

Merged opened this

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

Merged

scout/forge:scout/8140-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. scout/8140-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 76692e7.

Review

Sign in to review this change.
2 files changed +16 −1
src/checks/shared_red.ts +4
@@ -47,11 +47,15 @@ export const NO_TEST_NAME = "(unnamed)";
4747 * the rest of its suite is not a gate, and a test keeps it existing.
4848 * Reserved names (#7809): each pull adding a top-level page without
4949 * reserving it ("keeper", "feed", "favicon.ico") failed it, main green.
50 * OpenAPI coverage (#8140): each pull adding an /api/v1 route without its
51 * row, or a route file without regenerating the index, failed it, main green.
5052 */
5153 export const TREE_GATES: readonly string[] = [
5254 "design check: nothing added outside the system (#2678) > ",
5355 "no polling in src/web > ",
5456 "reserved names > every top-level page of the forge is a reserved name",
57 "every registered /api/v1 route has an OpenAPI row or is listed as not yet described",
58 "the gathered routes > the index is current: run `bun scripts/openapi-routes.ts`",
5559 ];
5660
5761 /** Whether a failing test's name is one of {@link TREE_GATES}'. */
test/shared-red.test.ts +12 −1
@@ -94,6 +94,16 @@ describe("a red many pulls share", () => {
9494 expect(shared(red("i3", [other]))).toBe(true);
9595 });
9696
97 test("an /api/v1 route a pull left undescribed is that pull's own red, not the lane's (#8140)", () => {
98 const gate = "every registered /api/v1 route has an OpenAPI row or is listed as not yet described";
99 for (const i of ["i1", "i2", "i3"]) red(i, [gate]);
100 expect(shared(red("i4", [gate]))).toBe(false);
101 const index = "the gathered routes > the index is current: run `bun scripts/openapi-routes.ts`";
102 for (const i of ["i1", "i2", "i3"]) red(i, [index]);
103 expect(shared(red("i4", [index]))).toBe(false);
104 expect(sharedTests(db)).toEqual([]);
105 });
106
97107 test("every tree gate names a suite, or a test in it, that exists", () => {
98108 const names = new Set<string>();
99109 for (const f of new Glob("test/*.test.ts").scanSync(".")) for (const n of suiteNames(readFileSync(f, "utf8"))) names.add(n);
@@ -106,6 +116,7 @@ describe("a red many pulls share", () => {
106116 expect(names.has("B > u")).toBe(true);
107117 expect(names.has("B > t")).toBe(false);
108118 expect(names.has("A > u")).toBe(false);
119 expect(suiteNames('test("top", () => {});\n').has("top")).toBe(true);
109120 });
110121
111122 test("one pull red three times is its own red, not the lane's", () => {
@@ -275,7 +286,7 @@ function suiteNames(text: string): Set<string> {
275286 let suite: string | undefined;
276287 for (const m of text.matchAll(/\b(describe|test)\("((?:[^"\\]|\\.)*)"/g)) {
277288 if (m[1] === "describe") names.add(`${(suite = m[2])} > `);
278 else if (suite !== undefined) names.add(`${suite} > ${m[2]}`);
289 else names.add(suite === undefined ? m[2]! : `${suite} > ${m[2]}`);
279290 }
280291 return names;
281292 }

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs