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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:oogsisrid2 is past its budget: trevato/forge: "(unnamed)" failed on 3 pulls in the last hour — the lane's red, not theirs; they wait for main's next g… #3004

Merged opened this

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

Merged

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

  • Merged. scout/2437-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as b5b2e2a.

Review

Sign in to review this change.
2 files changed +16 −2
src/checks/shared_red.ts +10 −2
@@ -31,6 +31,13 @@ export const SHARED_PULLS = 3;
3131 */
3232 const QUEUED_SLACK_MS = 6 * 3_600_000;
3333
34 /**
35 * What `bun test` prints for a failure that belongs to no test (an unhandled
36 * error, a hook): unrelated pulls share the label, not a cause, so it never
37 * makes a lane's red.
38 */
39 export const NO_TEST_NAME = "(unnamed)";
40
3441 export interface SharedTest {
3542 readonly repoId: string;
3643 /** `owner/name`, for the card. */
@@ -66,16 +73,17 @@ const PULLS_PER_TEST = `
6673 WHERE run.id >= ?1 AND run.finished_at >= ?2
6774 AND run.kind = 'check' AND run.issue_id IS NOT NULL AND run.state = 'failed'
6875 AND (?3 IS NULL OR run.repo_id = ?3)
69 AND n.type = 'text'
76 AND n.type = 'text' AND n.value <> ?4
7077 GROUP BY run.repo_id, n.value`;
7178
7279 function pullsPerTest(db: Database, now: number, repoId: string | null): Row[] {
7380 return db
74 .query<Row, [string, string, string | null]>(PULLS_PER_TEST)
81 .query<Row, [string, string, string | null, string]>(PULLS_PER_TEST)
7582 .all(
7683 idFloor(now - SHARED_WINDOW_MS - QUEUED_SLACK_MS),
7784 new Date(now - SHARED_WINDOW_MS).toISOString(),
7885 repoId,
86 NO_TEST_NAME,
7987 );
8088 }
8189
test/shared-red.test.ts +6
@@ -56,6 +56,12 @@ describe("a red many pulls share", () => {
5656 expect(shared(second)).toBe(true);
5757 });
5858
59 test("bun's (unnamed) label is no test: unrelated pulls sharing it are not the lane's", () => {
60 for (const i of ["i1", "i2", "i3"]) red(i, ["(unnamed)"]);
61 expect(shared(red("i4", ["(unnamed)"]))).toBe(false);
62 expect(sharedTests(db)).toEqual([]);
63 });
64
5965 test("one pull red three times is its own red, not the lane's", () => {
6066 red("i1", ["X"]);
6167 red("i1", ["X"]);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs