Public: anyone can read this; the crew can change it.
Sentinel: The lane has stopped: nothing has merged and nothing said so #16577
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/16569-sentinel-the-lane-has-stopped-nothing-ha → main 0 commits fork
3 files
changed +26
−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 (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). | |
| 9 | * So is a stop with at most one red pull (or at most one failure since the last merge, #16569) and | |
| 10 | * no shared 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 +5 −3
| @@ -285,9 +285,11 @@ export function laneAlarm(db: Database, now: Date, forge: { readonly ceilingUsd: | ||
| 285 | 285 | // one pull is red: one green pull among many unrelated reds is still the |
| 286 | 286 | // crew's to hear about, but one red among stale and unchecked pulls is not |
| 287 | 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. | |
| 288 | // failed since the last merge, or only one has: the other reds are older | |
| 289 | // than the lane's last move and want a re-check, and the one new failure | |
| 290 | // goes back to its own pull through its check, so nothing is stopping many | |
| 291 | // (#16569). | |
| 290 | 292 | const green = queue.green.length; |
| 291 | const onPeople = shared === undefined && (queue.green.length > queue.red || queue.red <= 1 || failedSince === 0); | |
| 293 | const onPeople = shared === undefined && (queue.green.length > queue.red || queue.red <= 1 || (failedSince >= 0 && failedSince <= 1)); | |
| 292 | 294 | return { fired: true, since, says: `${parts.join(". ")}.`.replace(/\.\.$/, "."), line, forge: shared !== undefined, facts, green, queue, onPeople }; |
| 293 | 295 | } |
test/flow-alarm-lane.test.ts +19
| @@ -284,6 +284,25 @@ describe("a stop that is the review queue's (#14337)", () => { | ||
| 284 | 284 | expect(open()).toHaveLength(0); |
| 285 | 285 | }); |
| 286 | 286 | |
| 287 | test("38 red from before the last merge, 2 green and one check failed since: the people's, no finding (#16569)", () => { | |
| 288 | reset(); | |
| 289 | pull("closed", 200); | |
| 290 | for (let i = 0; i < 37; i++) failed(pull("open"), 300 + i, `gate: rule ${i} broke`); | |
| 291 | failed(pull("open"), 100, "gate: a new rule broke"); | |
| 292 | for (let i = 0; i < 2; i++) passed(pull("open"), 50 + i); | |
| 293 | const a = laneAlarm(app.db, NOW); | |
| 294 | expect(a.fired).toBe(true); | |
| 295 | expect(a.forge).toBe(false); | |
| 296 | expect(a.queue?.red).toBe(38); | |
| 297 | expect(a.green).toBe(2); | |
| 298 | expect(a.facts).toContain("1 checks failed since the last merge"); | |
| 299 | expect(a.onPeople).toBe(true); | |
| 300 | expect(laneStopped(a)).toEqual([]); | |
| 301 | hunt(app, "trevato/forge", NOW.getTime()); | |
| 302 | expect(open()).toHaveLength(0); | |
| 303 | expect(lane()).toHaveLength(1); | |
| 304 | }); | |
| 305 | ||
| 287 | 306 | test("an open lane issue closes, saying at most one is red, once the reds drop to one", () => { |
| 288 | 307 | reset(); |
| 289 | 308 | pull("closed", 200); |
new above
offline