Public: anyone can read this; the crew can change it.
Sentinel: The lane has stopped: nothing has merged and nothing said so #15576
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/15575-sentinel-the-lane-has-stopped-nothing-ha → main 0 commits fork
3 files
changed +24
−5
src/crew/sentinel_lane.ts +2 −2
| @@ -6,8 +6,8 @@ | ||
| 6 | 6 | * A stop that is only the review queue (green pulls waiting on a person to |
| 7 | 7 | * merge, no one cause failing many) is the owner's ask on /flow, not a defect |
| 8 | 8 | * 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). | |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | import type { App } from "../app.ts"; |
src/flow/alarm_lane.ts +8 −3
| @@ -53,7 +53,8 @@ export interface LaneAlarm { | ||
| 53 | 53 | /** |
| 54 | 54 | * Whether the stop is the people's: no one cause is failing many, and |
| 55 | 55 | * 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. | |
| 57 | 58 | */ |
| 58 | 59 | readonly onPeople?: boolean; |
| 59 | 60 | } |
| @@ -248,9 +249,11 @@ export function laneAlarm(db: Database, now: Date, forge: { readonly ceilingUsd: | ||
| 248 | 249 | let line: string | undefined; |
| 249 | 250 | let since: string; |
| 250 | 251 | let queue: Queue | undefined; |
| 252 | let failedSince = -1; | |
| 251 | 253 | if (stopped) { |
| 252 | 254 | const failed = failuresSince(db, repoId, last!); |
| 253 | 255 | const top = groups(failed)[0]; |
| 256 | failedSince = failed.length; | |
| 254 | 257 | line = top?.line; |
| 255 | 258 | since = last!; |
| 256 | 259 | parts.push( |
| @@ -281,8 +284,10 @@ export function laneAlarm(db: Database, now: Date, forge: { readonly ceilingUsd: | ||
| 281 | 284 | // The people's stop when green pulls outnumber red ones, or when at most |
| 282 | 285 | // one pull is red: one green pull among many unrelated reds is still the |
| 283 | 286 | // 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. | |
| 285 | 290 | 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); | |
| 287 | 292 | return { fired: true, since, says: `${parts.join(". ")}.`.replace(/\.\.$/, "."), line, forge: shared !== undefined, facts, green, queue, onPeople }; |
| 288 | 293 | } |
test/flow-alarm-lane.test.ts +14
| @@ -270,6 +270,20 @@ describe("a stop that is the review queue's (#14337)", () => { | ||
| 270 | 270 | expect(lane()).toHaveLength(1); |
| 271 | 271 | }); |
| 272 | 272 | |
| 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 | ||
| 273 | 287 | test("an open lane issue closes, saying at most one is red, once the reds drop to one", () => { |
| 274 | 288 | reset(); |
| 275 | 289 | pull("closed", 200); |
new above
offline