Public: anyone can read this; the crew can change it.
Sentinel: Crew runs in trevato/cs-engine keep failing at the push or the sandbox #1893
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/1611-sentinel-crew-runs-in-trevato-cs-engine → main 1 commit fork
2 files
changed +21
−1
src/crew/sentinel.ts +6 −1
| @@ -303,7 +303,12 @@ export function runStreaks(db: Database): Finding[] { | ||
| 303 | 303 | lookFor: "A green check run for the repository's newest head.", |
| 304 | 304 | }); |
| 305 | 305 | } else { |
| 306 | const pushes = failed.filter((r) => /\bpush|sandbox|operation not permitted/i.test(r.summary)); | |
| 306 | // A decline is the run's own decision ("I pushed nothing"), not a push that failed. | |
| 307 | const pushes = failed.filter( | |
| 308 | (r) => | |
| 309 | !/^declined\b/i.test(r.summary.trim()) && | |
| 310 | /\bpush|sandbox|operation not permitted/i.test(r.summary), | |
| 311 | ); | |
| 307 | 312 | if (pushes.length < STREAK) continue; |
| 308 | 313 | out.push({ |
| 309 | 314 | key: `push:${repoId}`, |
test/sentinel.test.ts +15
| @@ -88,6 +88,21 @@ describe("a clean forge", () => { | ||
| 88 | 88 | }); |
| 89 | 89 | }); |
| 90 | 90 | |
| 91 | describe("a decline is not a failed push", () => { | |
| 92 | test("runs that say 'pushed nothing' file no push fault", async () => { | |
| 93 | const made = await createRepo(app, alice, { name: "quiet", visibility: "private" }); | |
| 94 | if (!made.ok) throw new Error(String(made.error)); | |
| 95 | for (let n = 0; n < 5; n++) { | |
| 96 | const run = createRun(app.db, { repoId: made.value.id, kind: "agent" }); | |
| 97 | app.db | |
| 98 | .query("UPDATE run SET state = 'failed', summary = ?2, created_at = ?3 WHERE id = ?1") | |
| 99 | .run(run.id, "declined: I made no changes and pushed nothing.", ago((30 + n) * HOUR)); | |
| 100 | } | |
| 101 | const keys = findFaults(app.db, NOW).map((f) => f.key); | |
| 102 | expect(keys).not.toContain(`push:${made.value.id}`); | |
| 103 | }); | |
| 104 | }); | |
| 105 | ||
| 91 | 106 | describe("the faults of the day", () => { |
| 92 | 107 | let queuedId = ""; |
| 93 | 108 | beforeAll(() => { |
new above
offline