From dd1237a7c69636ed685de29491bbd29bdc6e6a0f Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Sat, 7 Nov 2026 12:45:14 -0500 Subject: [PATCH] Settings: a self-hosted install's own AWS account never asks for a stack in AWS The install reads its own account with its own roles, whose read-only permissions arrive with each version update. Its card and the permissions panel say so, with a link to Version and updates, and never show Update in AWS. Other accounts keep the update stack. --- dashboard/e2e/integrations-page.spec.ts | 26 ++++++++++++++++++++ dashboard/src/components/aws-permissions.tsx | 13 ++++++++-- dashboard/src/components/connections.tsx | 19 +++++++++++--- dashboard/src/lib/api.ts | 4 +++ 4 files changed, 57 insertions(+), 5 deletions(-) diff --git a/dashboard/e2e/integrations-page.spec.ts b/dashboard/e2e/integrations-page.spec.ts index becefaa4..aaa2a4dc 100644 --- a/dashboard/e2e/integrations-page.spec.ts +++ b/dashboard/e2e/integrations-page.spec.ts @@ -355,6 +355,32 @@ 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 }) => { + const list = items().map((i) => + i.id === `aws-${ACCOUNT}` + ? { + ...i, + detail: awsDetail({ + missing: [], + update_url: null, + install_account: true, + permissions: { status: "update_needed", missing_count: 12 }, + }), + } + : i, + ); + await mockApi(page, { items: list }); + await page.goto("/settings/integrations"); + 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("These read-only permissions come with the next version update")).toBeVisible(); + await expect(panel.getByRole("link", { name: "Open Version and updates" })).toHaveAttribute("href", /\/settings\/system\/?#version$/); + 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); +}); + test("adding credentials to a switched-on server makes it connected", async ({ page }) => { const db = await mockApi(page); await page.goto("/settings/integrations"); diff --git a/dashboard/src/components/aws-permissions.tsx b/dashboard/src/components/aws-permissions.tsx index 625002ed..6ae1e497 100644 --- a/dashboard/src/components/aws-permissions.tsx +++ b/dashboard/src/components/aws-permissions.tsx @@ -1,11 +1,12 @@ "use client"; +import Link from "next/link"; import { useCallback, useEffect, useRef, useState } from "react"; import { api, type AwsConnection, type AwsPermissions } from "@/lib/api"; import { timeAgo } from "@/lib/data-sources"; import { Callout } from "./callout"; import { CheckIcon, ExternalLinkIcon, WarningIcon, AlertCircleIcon } from "./icons"; -import { buttonClass, primaryButton, secondaryButton } from "./ui"; +import { buttonClass, linkButton, primaryButton, secondaryButton } from "./ui"; import { Code } from "./settings/code"; // Whether each connected AWS account's read-only role has every permission @@ -270,8 +271,16 @@ export function PermissionsPanel({ account, perms, canEdit }: { account: string; {v.problem && (
- + {/* The install's own account: its version update brings these, so nothing is wrong in AWS. */} +

{v.problem.fix}

+ {v.install_account && ( +

+ + Open Version and updates + +

+ )}
)} diff --git a/dashboard/src/components/connections.tsx b/dashboard/src/components/connections.tsx index 93e7e2a1..e15dfd26 100644 --- a/dashboard/src/components/connections.tsx +++ b/dashboard/src/components/connections.tsx @@ -1,5 +1,6 @@ "use client"; +import Link from "next/link"; import { useState, type ReactNode } from "react"; import { api, type AwsAccountAbilities, type AwsAbilityReply, type Connector, type ConnectorId, type KeyConnectorKind } from "@/lib/api"; import { errorMessage, timeAgo } from "@/lib/data-sources"; @@ -332,8 +333,10 @@ export function AwsAbilitiesPanel({ return (

- Coderhelm checks what the CoderHelmLogReader role can do (one read of metrics, one list of Airflow environments) and turns each - ability on when the role allows it. {a.checked_at ? `Last checked ${timeAgo(a.checked_at)}.` : "Not checked yet."} + {a.install_account + ? "This is the install's own AWS account: Coderhelm reads it with the install's own role, and each version update brings that role's read-only permissions. Coderhelm checks what it can do (one read of metrics, one list of Airflow environments) and turns each ability on when it can." + : "Coderhelm checks what the CoderHelmLogReader role can do (one read of metrics, one list of Airflow environments) and turns each ability on when the role allows it."}{" "} + {a.checked_at ? `Last checked ${timeAgo(a.checked_at)}.` : "Not checked yet."}

{a.check_error && ( @@ -385,7 +388,17 @@ export function AwsAbilitiesPanel({ )}
- {(missing.length > 0 || a.permissions?.status === "update_needed") && a.update_url && ( + {a.install_account && (missing.length > 0 || a.permissions?.status === "update_needed") && ( + +

Nothing is needed in AWS. Update Coderhelm and they are on the install's own role.

+

+ + Open Version and updates + +

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