From 831bb078fb634baa3ff37716e817f226a1068bb1 Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Sat, 7 Nov 2026 12:45:18 -0500 Subject: [PATCH 1/3] Logs: a passed resolve date says what happens next, and failing checks show A finding past its quiet period no longer reads "Resolves on its own ". It says the next log check resolves it, or, when checks of that AWS account are failing, that it was due and why it hasn't resolved. A banner names each account whose checks fail, with the cause and a link to its AWS settings. --- dashboard/e2e/logs.spec.ts | 70 +++++++++++++++++++++++++++++++++ dashboard/src/app/logs/page.tsx | 30 +++++++++++++- dashboard/src/lib/api.ts | 13 ++++++ 3 files changed, 111 insertions(+), 2 deletions(-) diff --git a/dashboard/e2e/logs.spec.ts b/dashboard/e2e/logs.spec.ts index 90aaaaaf..a7ec6cf5 100644 --- a/dashboard/e2e/logs.spec.ts +++ b/dashboard/e2e/logs.spec.ts @@ -75,6 +75,8 @@ interface Backend { findings: Finding[]; autofix: Record; calls: Call[]; + /** AWS accounts whose log checks are failing (GET /api/log-findings). */ + analysis_failing?: unknown[]; } const DEFAULT_AUTOFIX = { enabled: false, min_severity: "critical", daily_cap: 3, scope: "all", quiet_hours: null, overrides: [], enabled_at: "" }; @@ -117,6 +119,7 @@ async function mockApi(page: Page, init: Partial = {}): Promise f.log_group as string))].sort(), aws_connected: db.connected, + analysis_failing: db.analysis_failing ?? [], }); } if (p === "/api/log-findings/autofix") { @@ -200,6 +203,73 @@ test("a quiet finding says when it resolves on its own, and a resolved one says await expect(page.getByRole("button", { name: "Mark as new" })).toBeVisible(); }); +test("a resolve date that has passed is never shown as a promise", async ({ page }) => { + const day = 86_400_000; + const ago = (ms: number) => new Date(Date.now() - ms).toISOString(); + // Quiet for 7 days with an 8-day period that ended a day ago: the next check resolves it. + const due = finding({ + rec_id: "rec_due", + status: "acknowledged", + title: "Prerender cache writes fail with no space left", + last_seen: ago(9 * day), + quiet_days: 8, + resolves_at: ago(1 * day), + resolve: { state: "due", at: ago(1 * day) }, + }); + // An older server sends only the date, already passed. + const legacy = finding({ + rec_id: "rec_legacy", + status: "new", + title: "Upstream timed out reading the session store", + last_seen: ago(7 * day), + quiet_days: 3, + resolves_at: ago(4 * day), + }); + await mockApi(page, { findings: [due, legacy] }); + await page.goto("/logs/"); + + for (const id of ["rec_due", "rec_legacy"]) { + const row = page.getByTestId(`finding-${id}`); + await expect(row).toContainText("Resolves at the next log check (every 6 hours) unless seen again."); + await expect(row).not.toContainText("Resolves on its own"); + } + await expect(page.getByTestId("analysis-failing")).toHaveCount(0); +}); + +test("when log checks fail, the page says so and why nothing resolves", async ({ page }) => { + const day = 86_400_000; + const ago = (ms: number) => new Date(Date.now() - ms).toISOString(); + const blocked = finding({ + rec_id: "rec_blocked", + status: "acknowledged", + title: "Prerender cache writes fail with no space left", + last_seen: ago(7 * day), + quiet_days: 8, + resolves_at: ago(1 * day), + resolve: { + state: "blocked", + at: ago(1 * day), + analysis_ok_at: ago(5 * day), + reason: "this install's permissions boundary stops CoderHelm from reading your AWS logs through the log reader role (fixed by updating CoderHelm)", + }, + }); + await mockApi(page, { + findings: [blocked], + analysis_failing: [{ account_id: "111122223333", last_ok_at: ago(5 * day), reason: "this install's permissions boundary stops CoderHelm from reading your AWS logs through the log reader role (fixed by updating CoderHelm)" }], + }); + await page.goto("/logs/"); + + const banner = page.getByTestId("analysis-failing"); + await expect(banner).toContainText("Log checks are failing for AWS account 111122223333"); + await expect(banner).toContainText("findings in this account don't update or resolve on their own"); + await expect(banner).toContainText("permissions boundary"); + await expect(banner.getByRole("link", { name: "Open AWS settings" })).toHaveAttribute("href", /\/settings\/integrations\/aws/); + const row = page.getByTestId("finding-rec_blocked"); + await expect(row).toContainText("It was due to resolve on its own"); + await expect(row).toContainText("but log checks have failed since"); + await expect(row).not.toContainText("unless seen again"); +}); + test("Logs is its own menu item, with Logs and Alerts as its tabs", async ({ page }) => { await mockApi(page); await page.goto("/logs/"); diff --git a/dashboard/src/app/logs/page.tsx b/dashboard/src/app/logs/page.tsx index cee0b29c..18c14964 100644 --- a/dashboard/src/app/logs/page.tsx +++ b/dashboard/src/app/logs/page.tsx @@ -89,7 +89,8 @@ const DAY_MS = 86_400_000; * Whether a finding is quiet, in words: "Quiet for 3 days. Resolves on its own * Nov 5 unless seen again." for an open one with no line for a day or more, * "Resolved on its own Nov 5 (no new lines for 3 days)." once the analyzer - * resolved it; null otherwise. + * resolved it; null otherwise. A date that has passed is never shown as a + * promise: it says when the next check resolves it, or why none can. */ function quietWords(f: LogFinding, now = Date.now()): string | null { if (f.status === "fixed" && f.resolved_at && f.fix?.state !== "merged") { @@ -99,7 +100,15 @@ function quietWords(f: LogFinding, now = Date.now()): string | null { if ((f.status === "new" || f.status === "acknowledged") && f.resolves_at && f.last_seen) { const quiet = Math.floor((now - Date.parse(f.last_seen)) / DAY_MS); if (!(quiet >= 1)) return null; - return `Quiet for ${plural(quiet, "day")}. Resolves on its own ${formatDate(f.resolves_at)} unless seen again.`; + const lead = `Quiet for ${plural(quiet, "day")}.`; + // Older servers send only the date: decide "passed" here. + const state = f.resolve?.state ?? (Date.parse(f.resolves_at) > now ? "scheduled" : "due"); + if (state === "blocked") { + const since = f.resolve?.analysis_ok_at ? ` since ${formatDate(f.resolve.analysis_ok_at)}` : ""; + return `${lead} It was due to resolve on its own ${formatDate(f.resolves_at)}, but log checks have failed${since}: ${f.resolve?.reason ?? "checks of your AWS logs fail"}.`; + } + if (state === "due") return `${lead} Resolves at the next log check (every 6 hours) unless seen again.`; + return `${lead} Resolves on its own ${formatDate(f.resolves_at)} unless seen again.`; } return null; } @@ -307,6 +316,23 @@ function LogsPage() { ) : ( <> + {(data?.analysis_failing ?? []).map((a) => ( +
+ + Open AWS settings + + } + > + {a.last_ok_at ? `The last check that worked was ${formatDate(a.last_ok_at)}. ` : "No check has worked yet. "} + Until checks work again, findings in this account don't update or resolve on their own. Cause: {a.reason}. + +
+ ))} ; log_groups: string[]; aws_connected: boolean; + /** AWS accounts whose log checks are failing, so findings there can't resolve. */ + analysis_failing?: { account_id: string; last_ok_at: string | null; reason: string }[]; } export interface LogSample { From 6ac6a1713960cd6a170d406f3068543e13ab3792 Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Sat, 7 Nov 2026 13:39:06 -0500 Subject: [PATCH 2/3] API field list at platform main --- dashboard/src/lib/openapi-fields.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/src/lib/openapi-fields.ts b/dashboard/src/lib/openapi-fields.ts index 50a115bd..2fa2b234 100644 --- a/dashboard/src/lib/openapi-fields.ts +++ b/dashboard/src/lib/openapi-fields.ts @@ -2,7 +2,7 @@ // docs/api/openapi.json. Do not edit; run `npm run openapi:fields` instead. /** The platform commit this was generated from. */ -export const OPENAPI_REF = "de34e9c10940158650799353fda932d6ca73c0a0"; +export const OPENAPI_REF = "579732b890c1c6689b0387c2c89ad7b0ee442a69"; /** The fields each public API schema has. */ export interface OpenApiFields { From 10f802951d40630763da5f5cedc61e588e0ca803 Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Sat, 7 Nov 2026 22:14:28 -0500 Subject: [PATCH 3/3] API field list at platform main --- dashboard/src/lib/openapi-fields.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/src/lib/openapi-fields.ts b/dashboard/src/lib/openapi-fields.ts index 2fa2b234..90fb9dfd 100644 --- a/dashboard/src/lib/openapi-fields.ts +++ b/dashboard/src/lib/openapi-fields.ts @@ -2,7 +2,7 @@ // docs/api/openapi.json. Do not edit; run `npm run openapi:fields` instead. /** The platform commit this was generated from. */ -export const OPENAPI_REF = "579732b890c1c6689b0387c2c89ad7b0ee442a69"; +export const OPENAPI_REF = "b25ce7b6fe2825b72a6bc191de6f288f2c22a9bc"; /** The fields each public API schema has. */ export interface OpenApiFields {