fix(cli): add rollback validation to lock step (template drift approach)#14701
Open
9pace wants to merge 3 commits intogen2-migrationfrom
Open
fix(cli): add rollback validation to lock step (template drift approach)#147019pace wants to merge 3 commits intogen2-migrationfrom
9pace wants to merge 3 commits intogen2-migrationfrom
Conversation
Remove unnecessary Printer adapter that wrapped this.logger and the
redundant `import type { Printer }`. The file already imports the
`printer` singleton from @aws-amplify/amplify-prompts, which is the
correct type expected by detectTemplateDrift() and CloudFormationService.
771bba1 to
c6424a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rollbackValidate()in the lock migration step to detect post-refactor state before allowing rollbackvalidateTemplateDrift()toAmplifyGen2MigrationValidations— runs Phase 2 (template drift) only, using CloudFormation change sets to compare deployed templates against the S3-cached baselineCloses #14570
Changes
_validations.ts: AddedvalidateTemplateDrift()method that syncs cloud backend from S3, then runsdetectTemplateDrift()to compare templates via change setslock.ts: ImplementedrollbackValidate()callingvalidateDeploymentStatus(),validateLockStatus(), andvalidateTemplateDrift()lock.test.ts: 5 unit tests for rollbackValidate() — happy path, error propagation for each validation_validations-template-drift.test.ts: 6 unit tests for validateTemplateDrift() — no drift, drift detected, S3 sync failure, skipped detection scenariosTest plan
lock.test.ts— 5 tests pass (rollbackValidate calls all validations, error propagation)_validations-template-drift.test.ts— 6 tests pass (template drift detection scenarios)npx jest --no-coverage