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

Sentinel: The lane has stopped: nothing has merged and nothing said so #15576

Merged opened this

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

Merged

scout/forge:scout/15575-sentinel-the-lane-has-stopped-nothing-ha → main 0 commits fork

  • Merged. scout/15575-sentinel-the-lane-has-stopped-nothing-ha was merged into main as fdac886.

Review

Sign in to review this change.
3 files changed +24 −5
src/crew/sentinel_lane.ts +2 −2
@@ -6,8 +6,8 @@
66 * A stop that is only the review queue (green pulls waiting on a person to
77 * merge, no one cause failing many) is the owner's ask on /flow, not a defect
88 * for the crew: no builder can merge, so filing it only parks a run (#14337).
9 * So is a stop with at most one red pull and no shared failure: the rest are
10 * stale or unchecked, which a person merges or re-checks (#15349).
9 * So is a stop with at most one red pull (or no failure since the last merge) and no shared
10 * failure: the rest are stale or unchecked, which a person merges or re-checks (#15349).
1111 */
1212
1313 import type { App } from "../app.ts";
src/flow/alarm_lane.ts +8 −3
@@ -53,7 +53,8 @@ export interface LaneAlarm {
5353 /**
5454 * Whether the stop is the people's: no one cause is failing many, and
5555 * either green pulls outnumber the red ones (#14337) or at most one pull
56 * is red (#15349). The owner is asked; the crew has nothing to fix.
56 * is red (#15349), or no check has failed since the last merge. The owner is asked; the crew has
57 * nothing to fix.
5758 */
5859 readonly onPeople?: boolean;
5960 }
@@ -248,9 +249,11 @@ export function laneAlarm(db: Database, now: Date, forge: { readonly ceilingUsd:
248249 let line: string | undefined;
249250 let since: string;
250251 let queue: Queue | undefined;
252 let failedSince = -1;
251253 if (stopped) {
252254 const failed = failuresSince(db, repoId, last!);
253255 const top = groups(failed)[0];
256 failedSince = failed.length;
254257 line = top?.line;
255258 since = last!;
256259 parts.push(
@@ -281,8 +284,10 @@ export function laneAlarm(db: Database, now: Date, forge: { readonly ceilingUsd:
281284 // The people's stop when green pulls outnumber red ones, or when at most
282285 // one pull is red: one green pull among many unrelated reds is still the
283286 // crew's to hear about, but one red among stale and unchecked pulls is not
284 // a defect any builder can fix (#15349).
287 // a defect any builder can fix (#15349). Nor is a stop where no check has
288 // failed since the last merge: the reds are older than the lane's last move
289 // and want a re-check, not a fix.
285290 const green = queue.green.length;
286 const onPeople = shared === undefined && (queue.green.length > queue.red || queue.red <= 1);
291 const onPeople = shared === undefined && (queue.green.length > queue.red || queue.red <= 1 || failedSince === 0);
287292 return { fired: true, since, says: `${parts.join(". ")}.`.replace(/\.\.$/, "."), line, forge: shared !== undefined, facts, green, queue, onPeople };
288293 }
test/flow-alarm-lane.test.ts +14
@@ -270,6 +270,20 @@ describe("a stop that is the review queue's (#14337)", () => {
270270 expect(lane()).toHaveLength(1);
271271 });
272272
273 test("33 open, three red from before the last merge and no check failed since: the people's, no finding (#15575)", () => {
274 reset();
275 pull("closed", 200);
276 for (let i = 0; i < 3; i++) failed(pull("open"), 300 + i, `gate: rule ${i} broke`);
277 for (let i = 0; i < 30; i++) pull("open");
278 const a = laneAlarm(app.db, NOW);
279 expect(a.fired).toBe(true);
280 expect(a.queue?.red).toBe(3);
281 expect(a.onPeople).toBe(true);
282 expect(laneStopped(a)).toEqual([]);
283 hunt(app, "trevato/forge", NOW.getTime());
284 expect(open()).toHaveLength(0);
285 });
286
273287 test("an open lane issue closes, saying at most one is red, once the reds drop to one", () => {
274288 reset();
275289 pull("closed", 200);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs