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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1ga9w5ebpp is past its budget: trevato/forge: "event audience coverage > every kind the source emits is classified" failed on 3 pulls in the last hour… #3817

Merged opened this

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

Merged

scout/forge:scout/3723-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/3723-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as a10f516.

Review

Sign in to review this change.
1 file changed +9 −3
test/event-audience-coverage.test.ts +9 −3
@@ -10,6 +10,7 @@
1010 import { describe, expect, test } from "bun:test";
1111 import { Glob } from "bun";
1212 import { readFileSync } from "node:fs";
13 import { join } from "node:path";
1314 import { classifiedAudience, eventAudience } from "../src/core/event_audience.ts";
1415
1516 /**
@@ -147,10 +148,13 @@ export function emittedKinds(files: Record<string, string>): {
147148 return { kinds, unreadable };
148149 }
149150
151 /** Anchored at the repository, not the working directory the runner happens to have. */
152 const ROOT = join(import.meta.dir, "..");
153
150154 async function sources(): Promise<Record<string, string>> {
151155 const out: Record<string, string> = {};
152 for await (const path of new Glob("src/**/*.ts").scan(".")) {
153 out[path] = readFileSync(path, "utf8");
156 for await (const path of new Glob("src/**/*.ts").scan(ROOT)) {
157 out[path] = readFileSync(join(ROOT, path), "utf8");
154158 }
155159 return out;
156160 }
@@ -164,7 +168,9 @@ describe("event audience coverage", () => {
164168 .map(([kind, at]) => `${kind} (${at})`);
165169 expect(missing).toEqual([]);
166170 expect(unreadable).toEqual([]);
167 });
171 // A scan of every source file is CPU work: a loaded check machine gets

Move this comment onto the test (above it) rather than between the assertions and the closing brace, and prefer a smaller bound (e.g. 15_000): the scan takes ~100 ms, so 60 s would let a real slowdown pass unnoticed.

172 // room, since only the code under test may decide the verdict.
173 }, 60_000);
168174
169175 test("an unclassified kind is for admins, never readers", () => {
170176 expect(classifiedAudience("brand.new_kind")).toBeUndefined();

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs