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

"pillars > merged pulls of the last 7 days count by the pillar of the issue each closes, on the board and in the map's data" passes every time on a loaded check machine #5452

Merged opened this

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

Merged

scout/forge:scout/5410-pillars-merged-pulls-of-the-last-7-days → main 1 commit fork

  • Merged. scout/5410-pillars-merged-pulls-of-the-last-7-days was merged into main as 2cdd3dc.

Review

Sign in to review this change.
1 file changed +12 −5
test/pillars.test.ts +12 −5
@@ -424,18 +424,25 @@ describe("pillars", () => {
424424 await land("composer", composer);
425425 await land("readme", loose);
426426 await land("nothing", null);
427 // Merged, but ten days ago: outside the week.
428427 const old = await land("verdict", parts[1]!);
429 app.db
430 .query("UPDATE pull SET merged_at = ?1 WHERE issue_id = ?2")
431 .run(new Date(Date.now() - 10 * 86_400_000).toISOString(), old);
428 // One instant for the whole case: the merges happened a minute before it
429 // however long they took, and the odd one out ten days before, outside
430 // the week. The view is read at that instant, not at whatever the clock
431 // says by the time the assertions run.
432 const T = Date.now();
433 const pin = (ago: number, where: string, ...args: string[]) =>
434 app.db
435 .query(`UPDATE pull SET merged_at = ?1 WHERE ${where}`)
436 .run(new Date(T - ago).toISOString(), ...args);
437 pin(60_000, "merged_at IS NOT NULL AND issue_id != ?2", old);
438 pin(10 * 86_400_000, "issue_id = ?2", old);
432439 const want = [
433440 { pillar: "P0 Trust", merged: 2 },
434441 { pillar: "P1 Feed", merged: 1 },
435442 { pillar: "Later", merged: 0 },
436443 { pillar: null, merged: 2 },
437444 ];
438 expect(pillarView(app.db, fresh())!.merged).toEqual(want);
445 expect(pillarView(app.db, fresh(), new Date(T))!.merged).toEqual(want);
439446 const data = await api("/api/v1/repos/alice/engine/map");
440447 // Nothing has gone live yet, so each pillar's ask-to-live is null: a dash.
441448 expect(data.mergedByPillar).toEqual({

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs