From 0849c316db87f15e2c1cef62bc25a38bcca2edab Mon Sep 17 00:00:00 2001 From: rcourtman Date: Wed, 25 Mar 2026 11:00:58 +0000 Subject: [PATCH] Keep setup completion identity local --- .../v6/internal/subsystems/agent-lifecycle.md | 5 +++ .../SetupWizard/SetupCompletionPanel.tsx | 6 ++-- .../SetupCompletionPanel.guardrails.test.ts | 5 +++ .../__tests__/SetupCompletionPanel.test.tsx | 35 +++++++++++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md index 633ff7a3a..5a509cfdd 100644 --- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md +++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md @@ -970,6 +970,11 @@ inventory. It may not present Docker, Kubernetes, Proxmox, or TrueNAS as competing primary onboarding paths, nor fall back to logo-led feature brochure copy that obscures the unified-resource contract the wizard is supposed to introduce. +That same connected-systems summary must preserve canonical local operator +identity for newly connected infrastructure. When governed resources such as +PBS or PMG appear in the setup-completion poll, the surface must show their +local instance labels instead of replacing those identities with governed +summary text, so the operator can tell which system actually connected. That same first-session setup-completion surface must also honor the lane's optional-auth install contract: when Pulse does not require API tokens, the wizard may switch to tokenless install commands only after an explicit operator diff --git a/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx b/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx index cc4ab82a9..e69c87f2f 100644 --- a/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx +++ b/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx @@ -18,7 +18,7 @@ import { trackUpgradeClicked, } from '@/utils/upgradeMetrics'; import { - getPreferredResourceDisplayName, + getPreferredInfrastructureDisplayName, getPreferredResourceHostname, } from '@/utils/resourceIdentity'; import { @@ -90,7 +90,7 @@ const hasAgentFacet = (resource: Resource): boolean => resourceHasAgentFacet(res const toNodeSummaryShape = (resource: Resource) => { const platformData = pd(resource); const proxmox = asRecord(platformData?.proxmox); - const name = getPreferredResourceDisplayName(resource); + const name = getPreferredInfrastructureDisplayName(resource); return { id: resource.id, name, @@ -101,7 +101,7 @@ const toNodeSummaryShape = (resource: Resource) => { const toAgentSummaryShape = (resource: Resource) => { const hostname = getPreferredResourceHostname(resource) || resource.id; - const name = getPreferredResourceDisplayName(resource); + const name = getPreferredInfrastructureDisplayName(resource); const id = getActionableAgentIdFromResource(resource) || resource.id; return { id, diff --git a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts index 0d8edfd19..d0cda1659 100644 --- a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts +++ b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts @@ -29,6 +29,11 @@ describe('SetupCompletionPanel guardrails', () => { expect(setupCompletionPanelSource).not.toContain('ProxmoxIcon'); }); + it('keeps connected infrastructure labels on the canonical local identity helper', () => { + expect(setupCompletionPanelSource).toContain('getPreferredInfrastructureDisplayName'); + expect(setupCompletionPanelSource).not.toContain('getPreferredResourceDisplayName(resource)'); + }); + it('does not reintroduce a separate setup-wizard install command surface', () => { expect(setupCompletionPanelSource).not.toContain('buildUnixAgentInstallCommand'); expect(setupCompletionPanelSource).not.toContain('buildWindowsAgentInstallCommand'); diff --git a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx index 582556996..f5b8e9e1b 100644 --- a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx +++ b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx @@ -192,6 +192,41 @@ describe('SetupCompletionPanel', () => { expect(onComplete).toHaveBeenCalledWith('/'); }); + it('keeps connected governed infrastructure on local operator identity', async () => { + apiFetchJSONMock.mockResolvedValue({ + resources: [ + { + id: 'pbs-1', + type: 'pbs', + name: 'redacted-pbs', + displayName: 'PBS Main', + status: 'online', + agent: { agentId: 'pbs-1' }, + platformData: { + pbs: { hostname: 'pbs.local', instanceId: 'pbs-main' }, + }, + policy: { + display: { + mode: 'governed', + summary: 'backup server resource; status online; sources pbs', + }, + }, + }, + ], + }); + + render(() => ); + + await waitFor(() => { + expect(screen.getByText('Connected (1 agent)')).toBeInTheDocument(); + }); + + expect(screen.getByText('PBS Main')).toBeInTheDocument(); + expect( + screen.queryByText('backup server resource; status online; sources pbs'), + ).not.toBeInTheDocument(); + }); + it('routes relay setup through the canonical settings destination', async () => { const onComplete = vi.fn(); apiFetchJSONMock.mockResolvedValue({