From 7e97f90c7d1d150f046b1aa7b6deff9445520c65 Mon Sep 17 00:00:00 2001 From: Aidan Daly Date: Thu, 25 Jun 2026 06:13:17 +0000 Subject: [PATCH] fix(unit-only): surface CloudFormation ROLLBACK events in deploy TUI (#1610) --- src/cli/tui/components/DeployStatus.tsx | 10 ++++++++-- .../components/__tests__/DeployStatus.test.tsx | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/cli/tui/components/DeployStatus.tsx b/src/cli/tui/components/DeployStatus.tsx index 837109a46..2c249d73e 100644 --- a/src/cli/tui/components/DeployStatus.tsx +++ b/src/cli/tui/components/DeployStatus.tsx @@ -66,7 +66,13 @@ type ResourceStatus = | 'UPDATE_FAILED' | 'DELETE_IN_PROGRESS' | 'DELETE_COMPLETE' - | 'DELETE_FAILED'; + | 'DELETE_FAILED' + | 'ROLLBACK_IN_PROGRESS' + | 'ROLLBACK_COMPLETE' + | 'ROLLBACK_FAILED' + | 'UPDATE_ROLLBACK_IN_PROGRESS' + | 'UPDATE_ROLLBACK_COMPLETE' + | 'UPDATE_ROLLBACK_FAILED'; interface ParsedResource { resourceType: string; @@ -103,7 +109,7 @@ function parseResourceMessage(msg: DeployMessage): ParsedResource | null { // Format: "StackName | STATUS | AWS::Service::Resource | LogicalId" const resourceMatch = /(AWS::\S+)/.exec(text); const statusMatch = - /(CREATE_IN_PROGRESS|CREATE_COMPLETE|CREATE_FAILED|UPDATE_IN_PROGRESS|UPDATE_COMPLETE|UPDATE_FAILED|DELETE_IN_PROGRESS|DELETE_COMPLETE|DELETE_FAILED)/.exec( + /(UPDATE_ROLLBACK_IN_PROGRESS|UPDATE_ROLLBACK_COMPLETE|UPDATE_ROLLBACK_FAILED|ROLLBACK_IN_PROGRESS|ROLLBACK_COMPLETE|ROLLBACK_FAILED|CREATE_IN_PROGRESS|CREATE_COMPLETE|CREATE_FAILED|UPDATE_IN_PROGRESS|UPDATE_COMPLETE|UPDATE_FAILED|DELETE_IN_PROGRESS|DELETE_COMPLETE|DELETE_FAILED)/.exec( text ); diff --git a/src/cli/tui/components/__tests__/DeployStatus.test.tsx b/src/cli/tui/components/__tests__/DeployStatus.test.tsx index 63aaa26e2..93b2733c9 100644 --- a/src/cli/tui/components/__tests__/DeployStatus.test.tsx +++ b/src/cli/tui/components/__tests__/DeployStatus.test.tsx @@ -95,6 +95,21 @@ describe('DeployStatus', () => { expect(lastFrame()).not.toContain('Some general info'); }); + it('renders ROLLBACK statuses instead of dropping the events', () => { + const messages = [ + makeResourceMsg('CloudFormation::Stack', 'ROLLBACK_IN_PROGRESS'), + makeResourceMsg('BedrockAgentCore::Gateway', 'UPDATE_ROLLBACK_IN_PROGRESS'), + makeResourceMsg('CloudFormation::Stack', 'ROLLBACK_FAILED'), + ]; + + const { lastFrame } = render(); + const frame = lastFrame()!; + + expect(frame).toContain('ROLLBACK_IN_PROGRESS'); + expect(frame).toContain('UPDATE_ROLLBACK_IN_PROGRESS'); + expect(frame).toContain('ROLLBACK_FAILED'); + }); + it('shows only last 8 resource events', () => { const messages = Array.from({ length: 12 }, (_, i) => makeResourceMsg(`Service::Resource${i}`, 'CREATE_COMPLETE')