Skip to content

feat(gen2-migration): add deployment status validation and unit tests for safe migrations#14313

Merged
iliapolo merged 1 commit intogen2-migrationfrom
sai/validate-deployment-status-for-gen2-migration
Nov 3, 2025
Merged

feat(gen2-migration): add deployment status validation and unit tests for safe migrations#14313
iliapolo merged 1 commit intogen2-migrationfrom
sai/validate-deployment-status-for-gen2-migration

Conversation

@sai-ray
Copy link
Copy Markdown
Contributor

@sai-ray sai-ray commented Oct 31, 2025

Description of changes

This PR implements deployment status validation to ensure CloudFormation root stack for amplify app is in a stable state before proceeding with Gen 1 to Gen 2 migrations. The implementation adds a validateDeploymentStatus() method that queries the CloudFormation root stack status using AWS SDK v3 and validates that the stack exists and is in either CREATE_COMPLETE or UPDATE_COMPLETE state. When validation fails, it throws appropriate AmplifyError instances (StackNotFoundError or StackStateError) with clear messaging to guide users on resolution steps.

Issue #, if available

Description of how you validated changes

Added unit tests covering multiple scenarios:

  • Missing stack validation: Stack name not found in amplify-meta
  • Stack not found in CloudFormation: Stack doesn't exist in AWS
  • Valid stable states: CREATE_COMPLETE and UPDATE_COMPLETE statuses pass validation
  • Invalid states: UPDATE_IN_PROGRESS and ROLLBACK_COMPLETE statuses throw errors

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sai-ray sai-ray requested a review from a team as a code owner October 31, 2025 18:01
@iliapolo iliapolo changed the title feat(gen2_migration): add deployment status validation and unit tests for safe migrations feat(gen2-migration): add deployment status validation and unit tests for safe migrations Nov 3, 2025
@sai-ray sai-ray force-pushed the sai/validate-deployment-status-for-gen2-migration branch from b2214fc to 3e007c8 Compare November 3, 2025 22:10
@iliapolo iliapolo merged commit 4bce411 into gen2-migration Nov 3, 2025
4 checks passed
@iliapolo iliapolo deleted the sai/validate-deployment-status-for-gen2-migration branch November 3, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants