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

Sentinel: red:01m23vygyffx5hg2f5vm8r74sr is past its budget: trevato/forge: main is red at 15ed15b — "GET /api/v1/boards/:slug/panels/:id > a panel not grouped by time ignores the … #3934

Merged opened this

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

Merged

scout/forge:scout/3917-sentinel-red-01m23vygyffx5hg2f5vm8r74sr → main 2 commits fork

  • Merged. scout/3917-sentinel-red-01m23vygyffx5hg2f5vm8r74sr was merged into main as 745b304.

Review

Sign in to review this change.
1 file changed +8 −3
test/boards-panel-data.test.ts +8 −3
@@ -159,7 +159,10 @@ describe("GET /api/v1/boards/:slug/panels/:id", () => {
159159 expect(res.status).toBe(200);
160160 const out = (await res.json()) as Out;
161161 expect([out.board, out.panel, out.title, out.step]).toEqual(["usage-test", 0, "Pod CPU", 300]);
162 expect(out.rows.at(-1)!.group).toBe(minute(Math.floor(LAST / 300_000) * 300_000));
162 // The seed minute's bucket, or a later one if the clock crossed a 5-minute mark since the file loaded.
163 const seeded = Math.floor(LAST / 300_000) * 300_000;
164 const nowMark = Math.floor(Date.now() / 300_000) * 300_000;
165 expect([minute(seeded), minute(nowMark)]).toContain(out.rows.at(-1)!.group);
163166 });
164167
165168 test("step=1m over 24 h is all 1440 minutes; step=5m over an aligned day is 288 buckets", async () => {
@@ -190,10 +193,12 @@ describe("GET /api/v1/boards/:slug/panels/:id", () => {
190193 });
191194
192195 test("a panel not grouped by time ignores the step; a text cell is never a formula", async () => {
193 const out = (await (await api("/api/v1/boards/usage-test/panels/1?step=5m")).json()) as Out;
196 // The day of points is pinned, so a minute turning over mid-run can't drop the oldest one.
197 const day = `from=${new Date(LAST - 86_400_000).toISOString()}`;
198 const out = (await (await api(`/api/v1/boards/usage-test/panels/1?step=5m&${day}`)).json()) as Out;
194199 expect(out.step).toBeNull();
195200 expect(out.rows.map((r) => r.group)).toEqual(['=HYPERLINK("x")', "forge"]);
196 const csv = await (await api("/api/v1/boards/usage-test/panels/1?format=csv")).text();
201 const csv = await (await api(`/api/v1/boards/usage-test/panels/1?format=csv&${day}`)).text();
197202 expect(csv).toBe(`group,value\r\n"'=HYPERLINK(""x"")",1\r\nforge,1440\r\n`);
198203 });
199204

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs