feat: auth and storage refactor#14304
Conversation
192fe8e to
c671368
Compare
| const MIGRATION_DIR = '.amplify/migration'; | ||
| const AMPLIFY_DIR = 'amplify'; | ||
|
|
||
| export class AmplifyMigrationRefactorStep extends AmplifyMigrationStep { |
There was a problem hiding this comment.
why did you decide to move this away from src/commands/gen2-migration/refactor.ts?
There was a problem hiding this comment.
I could have kept the name, it there is so much accessory code that it made sense to organize it in its own directory. Using an index file is the usual convention, in that case.
There was a problem hiding this comment.
why are test files included alongside source code? seems to me like convention in this repository is to include tests in the src/__tests__/ folder
There was a problem hiding this comment.
Makes sense, I'll move the tests there.
689e6d7 to
3b865d7
Compare
| if (resource?.DependsOn) { | ||
| // Normalize DependsOn to array for processing | ||
| const deps = Array.isArray(resource.DependsOn) ? resource.DependsOn : [resource.DependsOn]; | ||
| const depsInRefactor = deps.filter((dep: string) => resourcesToRefactor.includes(dep)); |
There was a problem hiding this comment.
Functional change here. Normalize DependsOn, which can be either a string or an array of strings, to be an array.
Description of changes
Moved over and modified code from https://github.com/aws-amplify/amplify-cli/tree/migrations/packages/amplify-migration/src/commands/gen2/execute.
Auth and Storage.
Added an assessment state that displays resources available to migrate

Added interactivity to allow migration per category.
Description of how you validated changes
Manual testing and deployment. Unit tests copied over.
Steps:
amplify-dev gen2-migration refactor --from amplify-amplifytestapp2-migrate-3e996 --to amplify-dzb1rpv3p7ih3-migrate-branch-caf557ea2d --debug(amplify-dev) must be linked correctly).s3.bucketNameor the deployment will create a new bucket (we do not want this).Added debug logging:
Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.