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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:dakr3k5d6v is past its budget: trevato/forge: "design check: nothing added outside the system (#2678) > the tree is no worse than its baseline" failed… #3022

Merged opened this

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

Merged

mason/forge:mason/2868-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. mason/2868-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as ee26c60.

Review

Sign in to review this change.
2 files changed +35 −1
src/checks/shared_red.ts +17 −1
@@ -38,6 +38,21 @@ const QUEUED_SLACK_MS = 6 * 3_600_000;
3838 */
3939 export const NO_TEST_NAME = "(unnamed)";
4040
41 /**
42 * Suites that are gates on the tree itself (#2868): each reads the source and
43 * fails the pull that added the thing it forbids, the same way on any
44 * machine. Many pulls tripping one in an hour is many pulls each adding
45 * what it forbids (a class DESIGN.md does not name), not a lane's red, so they never make one.
46 * A name here is a suite's `describe` prefix, and a test keeps it existing.
47 */
48 export const TREE_GATES: readonly string[] = [
49 "design check: nothing added outside the system (#2678) > ",
50 "no polling in src/web > ",
51 ];
52
53 /** Whether a failing test's name is one of {@link TREE_GATES}'. */
54 export const isTreeGate = (test: string): boolean => TREE_GATES.some((g) => test.startsWith(g));
55
4156 export interface SharedTest {
4257 readonly repoId: string;
4358 /** `owner/name`, for the card. */
@@ -84,7 +99,8 @@ function pullsPerTest(db: Database, now: number, repoId: string | null): Row[] {
8499 new Date(now - SHARED_WINDOW_MS).toISOString(),
85100 repoId,
86101 NO_TEST_NAME,
87 );
102 )
103 .filter((r) => !isTreeGate(r.test));
88104 }
89105
90106 /**
test/shared-red.test.ts +18
@@ -6,6 +6,8 @@
66 */
77 import { beforeEach, describe, expect, test } from "bun:test";
88 import type { Database } from "bun:sqlite";
9 import { Glob } from "bun";
10 import { readFileSync } from "node:fs";
911 import { tmpdir } from "node:os";
1012 import { migrations } from "../src/core/schema.ts";
1113 import { openDb } from "../src/kernel/db.ts";
@@ -13,6 +15,7 @@ import { claimRun, createRun, finishRun, type Run } from "../src/core/runs.ts";
1315 import {
1416 SHARED_PULLS,
1517 SHARED_WINDOW_MS,
18 TREE_GATES,
1619 flakeHref,
1720 flakeKey,
1821 sharedCause,
@@ -62,6 +65,21 @@ describe("a red many pulls share", () => {
6265 expect(sharedTests(db)).toEqual([]);
6366 });
6467
68 test("a gate on the tree is each pull's own red, however many trip it (#2868)", () => {
69 const gate = "design check: nothing added outside the system (#2678) > the tree is no worse than its baseline";
70 for (const i of ["i1", "i2", "i3"]) red(i, [gate]);
71 expect(shared(red("i4", [gate]))).toBe(false);
72 expect(shared(red("i5", [gate, "X"]))).toBe(false);
73 expect(sharedTests(db)).toEqual([]);
74 });
75
76 test("every tree gate names a suite that exists", () => {
77 const suites = new Set<string>();
78 for (const f of new Glob("test/*.test.ts").scanSync("."))
79 for (const m of readFileSync(f, "utf8").matchAll(/describe\("((?:[^"\\]|\\.)*)"/g)) suites.add(`${m[1]} > `);
80 for (const g of TREE_GATES) expect(suites.has(g)).toBe(true);
81 });
82
6583 test("one pull red three times is its own red, not the lane's", () => {
6684 red("i1", ["X"]);
6785 red("i1", ["X"]);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs