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

The sentinel files no crew issue for a drill cause: running a drill is a person's, not a builder's #5370

Merged opened this

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

Merged

scout/forge:scout/5367-the-sentinel-files-no-crew-issue-for-a-d → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/5367-the-sentinel-files-no-crew-issue-for-a-d was merged into main as fbcfda7.

Review

Sign in to review this change.
2 files changed +15 −1
src/crew/sentinel.ts +5 −1
@@ -8,7 +8,9 @@
88 * thing that files.
99 *
1010 * Left to a person, on purpose: the ingress routes at the edge are not in
11 * this database, and a fix is not opened as a pull by the sentinel — each
11 * this database, a `drill:` cause is cleared by a person running
12 * `scripts/drills/run.ts` against production (the vitals card still shows
13 * it, and no issue is filed), and a fix is not opened as a pull by the sentinel — each
1214 * finding that has a mechanical fix says what it is, and a run of the crew
1315 * picks the issue up like any other.
1416 */
@@ -406,6 +408,8 @@ const BREACH_CAUSE = /^(queue:check|stuck:|budget:|red:|shared:)/;
406408 * `forgeRepoId` unset means no repository is known and nothing is dropped.
407409 */
408410 export function ownCause(cause: string, forgeRepoId: string | undefined): boolean {
411 // A drill is run against production by a person (#5367): no builder can, so no issue.

Nit: the docblock above ownCause only explains the other-repository case; add one line that a drill: cause is never ours to file.

412 if (cause.startsWith("drill:")) return false;
409413 if (forgeRepoId === undefined) return true;
410414 if (cause.startsWith("red:")) return cause === `red:${forgeRepoId}`;
411415 if (cause.startsWith("shared:")) return cause.split(":")[1] === forgeRepoId;
test/sentinel.test.ts +10
@@ -576,6 +576,16 @@ describe("degraded causes", () => {
576576 plantSpan("disk", day - 3 * 3_600_000, 6);
577577 expect(degradedCauses(dapp.db, day).map((f) => f.key)).toEqual(["degraded:disk"]);
578578 });
579
580 test("a drill cause is a person's: no issue, but a shared one of the forge's own still is", () => {
581 const day = D_NIGHT + 10 * D_DAY;
582 plantSpan("drill:never", day - 5 * 3_600_000, 30);
583 plantSpan("drill:compute", day - 3 * 3_600_000, 30);
584 expect(degradedCauses(dapp.db, day, drepo.id)).toEqual([]);
585 expect(degradedCauses(dapp.db, day)).toEqual([]);
586 plantSpan(`shared:${drepo.id}:abc`, day - 2 * 3_600_000, 30);
587 expect(degradedCauses(dapp.db, day, drepo.id).map((f) => f.key).length).toBe(1);
588 });
579589 });
580590
581591 // ---- budget breaches (#1270) ----

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs