From 94f38bf3a7bc822cd7efb362fd9e6f9b32d8450b Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Thu, 19 Nov 2026 09:50:46 -0500 Subject: [PATCH] The install's own AWS account updates with the release: nothing to do The AWS page and the integrations card showed an amber "needed" card for the install's own account, with Update now and Update from the AWS page. The release now brings that account's read-only permissions to its CoderHelmLogReader by itself (the access stack's reader update, platform), so the card says "Updates with the release", lists what arrives, and offers nothing to press. Other accounts keep their one-click update stack. --- dashboard/e2e/aws-install-options.spec.ts | 77 ++++++-------------- dashboard/e2e/integrations-page.spec.ts | 8 +- dashboard/src/components/aws-permissions.tsx | 69 +++++++++++------- dashboard/src/components/connections.tsx | 9 +-- 4 files changed, 72 insertions(+), 91 deletions(-) diff --git a/dashboard/e2e/aws-install-options.spec.ts b/dashboard/e2e/aws-install-options.spec.ts index b4aa23fd..4cc1cedf 100644 --- a/dashboard/e2e/aws-install-options.spec.ts +++ b/dashboard/e2e/aws-install-options.spec.ts @@ -175,60 +175,29 @@ async function shot(page: Page, name: string) { await page.setViewportSize({ width: 1280, height: 800 }); } -test("a permission the next release adds: Update now to add it, then it arrives with the update installing now", async ({ page }) => { - const db = await backend(page, { missing: ["logs:StopQuery"], latest: "v1.5.0" }); - await page.goto("/settings/integrations/aws/"); - const panel = page.getByTestId(`aws-perms-${INSTALL}`); - await expect(panel.getByRole("heading", { name: "1 permission arrives with the next update" })).toBeVisible(); - await expect(panel.locator("section")).toHaveAttribute("data-case", "install"); - // Needed now is only the missing permission; the optional reads are apart and collapsed. - const needed = panel.getByTestId(`aws-needed-${INSTALL}`); - await expect(needed).toContainText("logs:StopQuery"); - await expect(needed).not.toContainText("Amazon Inspector"); - const optional = panel.getByTestId(`aws-optional-${INSTALL}`); - await expect(optional).toContainText("Optional, off: 2 reads"); - await expect(optional.getByTestId("aws-optional-inspector")).toBeHidden(); - // Never "go to another page and figure it out": the update is right here. - await expect(panel.getByRole("link", { name: /Open Version and updates/ })).toHaveCount(0); - await expect(panel.getByTestId("install-needed-update")).toContainText("v1.5.0 adds it"); - await shot(page, "aws-install-update-available"); - - await panel.getByRole("button", { name: "Update now to add it" }).click(); - const press = db.calls.find((c) => c.path === "/api/system/update"); - expect(press?.body).toEqual({ accept_permissions: true }); - await expect(panel.getByRole("heading", { name: "1 permission arrives with the update installing now" })).toBeVisible(); - await expect(panel.getByTestId("install-needed-running")).toContainText("Arrives with the update to v1.5.0 installing now"); - await shot(page, "aws-install-update-running"); -}); - -test("this version already grants it: the card says exactly why and offers the fix", async ({ page }) => { - await backend(page, { - missing: ["logs:StopQuery"], - problem: { code: "install_boundary", message: "This install's permission limit doesn't allow 1 of these read-only permissions yet.", fix: "An AWS admin applies the install's access update once (Settings, System, Version, Permissions: one link to the AWS console). No version update can change the limit." }, - access: { state: "pending", link: "https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?stackName=coderhelm-prod-access" }, - }); - await page.goto("/settings/integrations/aws/"); - const panel = page.getByTestId(`aws-perms-${INSTALL}`); - await expect(panel.getByRole("heading", { name: "1 permission is blocked by this install's permission limit" })).toBeVisible(); - const why = panel.getByTestId("install-needed-boundary"); - await expect(why).toContainText("v1.4.0 grants it, but this install's permission limit doesn't allow 1"); - await expect(why.getByRole("link", { name: /Open the access update in AWS/ })).toHaveAttribute("href", /stackName=coderhelm-prod-access/); - await expect(panel.getByRole("button", { name: "Update now to add it" })).toHaveCount(0); - await shot(page, "aws-install-current-boundary"); -}); - -test("no newer version and nothing blocks it: what IAM says is missing, on which role, never a claim about the stack", async ({ page }) => { - await backend(page, { missing: ["logs:StopQuery"] }); - await page.goto("/settings/integrations/aws/"); - const panel = page.getByTestId(`aws-perms-${INSTALL}`); - await expect(panel.getByRole("heading", { name: "1 permission missing from this install's read role" })).toBeVisible(); - const why = panel.getByTestId("install-needed-current"); - await expect(why).toContainText("IAM's policy simulator says coderhelm-prod-ServiceRole-0a1b2c3d isn't allowed logs:StopQuery"); - await expect(why).toContainText("no newer version is out yet"); - // Nothing it didn't read: no "your stack grants it", no drift. - await expect(why).not.toContainText(/grants it, yet|drift|changed in AWS/); - await expect(why.getByRole("button", { name: "Check again" })).toBeVisible(); - await shot(page, "aws-install-missing-no-update"); +test("the install's own account: it updates with the release, and there is nothing to do", async ({ page }) => { + // Whatever is out (a newer version, none) and whatever the check says: never an action. + for (const latest of ["v1.5.0", null]) { + await backend(page, { missing: ["logs:StopQuery"], latest }); + await page.goto("/settings/integrations/aws/"); + const panel = page.getByTestId(`aws-perms-${INSTALL}`); + await expect(panel.getByRole("heading", { name: "Updates with the release" })).toBeVisible(); + await expect(panel.locator("section").first()).toHaveAttribute("data-case", "install"); + await expect(panel.getByTestId(`aws-install-reads-${INSTALL}`)).toContainText("Each version update brings it to"); + await expect(panel.getByTestId(`aws-install-reads-${INSTALL}`)).toContainText("so there is nothing to do"); + // What arrives is listed; the optional reads stay apart and collapsed. + const needed = panel.getByTestId(`aws-needed-${INSTALL}`); + await expect(needed).toContainText("logs:StopQuery"); + await expect(needed).not.toContainText("Amazon Inspector"); + await expect(panel.getByTestId(`aws-optional-${INSTALL}`)).toContainText("Optional, off: 2 reads"); + // Nothing to press and nowhere to go: no update stack, no update button, no warning. + const card = panel.locator("section").first(); + await expect(card.getByRole("button")).toHaveCount(0); + await expect(card.getByRole("link")).toHaveCount(0); + await expect(panel.getByRole("link", { name: /Update in AWS/ })).toHaveCount(0); + await expect(panel.getByRole("heading", { name: /Update needed/ })).toHaveCount(0); + await shot(page, latest ? "aws-install-updates-with-release" : "aws-install-updates-with-release-no-newer"); + } }); test("an optional read switches on the install's own stack: review of exactly what it adds, confirm, progress, result", async ({ page }) => { diff --git a/dashboard/e2e/integrations-page.spec.ts b/dashboard/e2e/integrations-page.spec.ts index 980181cd..5fdeb71e 100644 --- a/dashboard/e2e/integrations-page.spec.ts +++ b/dashboard/e2e/integrations-page.spec.ts @@ -372,7 +372,7 @@ test("an AWS role without the permissions offers the one-click stack", async ({ await expect(aws.getByRole("switch", { name: "Let agents read Airflow" })).toBeDisabled(); }); -test("a self-hosted install's own account never asks for a stack in AWS: the version update brings the permissions", async ({ page }) => { +test("a self-hosted install's own account never asks for anything: the release brings the permissions", async ({ page }) => { const list = items().map((i) => i.id === `aws-${ACCOUNT}` ? { @@ -391,8 +391,10 @@ test("a self-hosted install's own account never asks for a stack in AWS: the ver const aws = row(page, `aws-${ACCOUNT}`); await control(page, `aws-${ACCOUNT}`, `AWS account ${ACCOUNT}`).click(); const panel = aws.getByTestId(`aws-panel-${ACCOUNT}`); - await expect(panel.getByText(/read-only permissions? arrives? with the next update/)).toBeVisible(); - await expect(panel.getByRole("link", { name: "Update from the AWS page" })).toHaveAttribute("href", /\/settings\/integrations\/aws\/?#aws-account-/); + await expect(panel.getByText(/Updates with the release: 12 read-only permissions arrive with the next update/)).toBeVisible(); + await expect(panel.getByText(/^Nothing to do\./)).toBeVisible(); + // Nothing to press: no update stack, no "update from the AWS page". + await expect(panel.getByRole("link", { name: "Update from the AWS page" })).toHaveCount(0); await expect(panel.getByText("the install's own AWS account", { exact: false })).toBeVisible(); await expect(aws.getByRole("link", { name: "Update in AWS" })).toHaveCount(0); await expect(panel.getByText("CoderHelmLogReader")).toHaveCount(0); diff --git a/dashboard/src/components/aws-permissions.tsx b/dashboard/src/components/aws-permissions.tsx index 32d86332..a15db969 100644 --- a/dashboard/src/components/aws-permissions.tsx +++ b/dashboard/src/components/aws-permissions.tsx @@ -7,7 +7,7 @@ import { Callout } from "./callout"; import { CheckIcon, ExternalLinkIcon, WarningIcon, AlertCircleIcon } from "./icons"; import { buttonClass, primaryButton, secondaryButton } from "./ui"; import { Code } from "./settings/code"; -import { InstallNeededNow, OptionalReads, installHeader, useInstallStatus } from "./aws-install-options"; +import { OptionalReads, useInstallStatus } from "./aws-install-options"; // Whether each connected AWS account's read-only role has every permission // this release uses, checked live (IAM's policy simulator on the role, or one @@ -115,8 +115,8 @@ export function stateLabel(s: AccountPermissions): string { if (!v) return s.checking ? "Checking permissions" : s.error ? "Couldn't check permissions" : "Not checked yet"; if (v.status === "up_to_date") return "Permissions up to date"; if (v.status === "error") return "Can't check: Coderhelm can't take on the role"; - // The install's own account: nothing to do in AWS, its next update brings them. - if (v.install_account) return `${v.missing_count} permission${v.missing_count === 1 ? "" : "s"} ${v.missing_count === 1 ? "arrives" : "arrive"} with the next update`; + // The install's own account: the release brings them to its reader by itself. + if (v.install_account) return "Updates with the release"; return `Update needed: ${v.missing_count} new read-only permission${v.missing_count === 1 ? "" : "s"}`; } @@ -269,13 +269,47 @@ export function PermissionsPanel({ account, perms, canEdit }: { account: string; const neededGroups = v.abilities.filter((a) => !a.optional && a.missing.length > 0); const waiting = !!s.pressedAt && !v.problem; - const title = install ? installHeader(v.missing_count, status, v.problem?.code) : stateLabel(s); + + // The install's own account: each version update brings this release's + // reads to its CoderHelmLogReader (the access stack's reader update), so + // there is nothing to do here: no update stack, no button, no warning. + if (install) { + const n = v.missing_count; + return ( +
+
+
+
+

+ Updates with the release +

+

+ This install's own account. This release reads a little more from it: {n} read-only permission{n === 1 ? "" : "s"}. Each version + update brings {n === 1 ? "it" : "them"} to {v.role || "CoderHelmLogReader"} here by itself, so there is nothing to do. Until + then, Coderhelm skips what needs {n === 1 ? "it" : "them"} and keeps working with the rest. +

+
+

+ {v.missing.map((m) => ( + + {m.action} + + ))} +

+
+
+ {optional} +
+ ); + } + + const title = stateLabel(s); return (
@@ -287,9 +321,7 @@ export function PermissionsPanel({ account, perms, canEdit }: { account: string; {title}

- {install - ? "This install's own account. This release reads a little more from it; everything stays read-only, and nothing is needed in AWS." - : `This release reads a little more from account ${v.account}. Everything stays read-only: Coderhelm can list, describe and query, never change anything.`}{" "} + {`This release reads a little more from account ${v.account}. Everything stays read-only: Coderhelm can list, describe and query, never change anything.`}{" "} Until the role has it, Coderhelm skips what needs it and keeps working with the rest.

@@ -314,23 +346,7 @@ export function PermissionsPanel({ account, perms, canEdit }: { account: string;
- {install ? ( -
- {canEdit ? ( - perms.check(account, true)} - checking={s.checking} - role={v.role} - missing={v.missing.map((m) => m.action)} - /> - ) : ( -

An admin adds it from this card with the install's next version update.

- )} -
- ) : ( - <> + <> {v.problem && (
@@ -377,8 +393,7 @@ export function PermissionsPanel({ account, perms, canEdit }: { account: string;
)} {!canEdit &&

An admin can update the role in one click from this page.

} - - )} +
{optional} diff --git a/dashboard/src/components/connections.tsx b/dashboard/src/components/connections.tsx index dcd15ca0..d0233774 100644 --- a/dashboard/src/components/connections.tsx +++ b/dashboard/src/components/connections.tsx @@ -422,15 +422,10 @@ export function AwsAbilitiesPanel({ {a.install_account && (missing.length > 0 || a.permissions?.status === "update_needed") && ( -

Nothing is needed in AWS. The AWS page updates Coderhelm in one press, and the install's own role has them once it finishes.

-

- - Update from the AWS page - -

+

Nothing to do. Each version update brings this release's read-only permissions to this account's read role by itself.

)} {!a.install_account && (missing.length > 0 || a.permissions?.status === "update_needed") && a.update_url && (