Skip to content

Conversation

@iankhou
Copy link
Contributor

@iankhou iankhou commented Jan 5, 2026

Description of changes

This is a CLI. See log example at the end.

Set up configurations for each sample app and configuration loaders. Introduce classes that can execute Amplify deployments either locally or to Atmosphere.

If using Atmosphere, you must have a .gamma.env file with properly configured variables according to the README.

If not, the migration system will pull from your default profile named [default] to deploy Amplify apps, unless you specify --profile.

About 40% of this change is tests.

Description of how you validated changes

Unit tests.

Used atmosphere endpoint to run integration and e2e tests that run amplify init. Deployed amplify apps using this CLI to my personal dev account using profiles under different names, and also the default profile on my system.

Next steps

  • Category addition logic
  • Author an e2e test that and adds all categories (after amplify init)
  • Author an e2e test that runs amplify init, adds categories

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

Log example

$ npm run dev -- --apps app-1

> amplify-migration-system@1.0.0 dev
> ts-node src/cli.ts --apps app-1

[2026-01-05T21:17:18.705Z] [INFO]  File logging enabled: ./logs/amplify-migration-2026-01-05.log

╔══════════════════════════════════════════════════════════════╗
║                                                              ║
║           AWS Amplify Gen1 to Gen2 Migration System          ║
║                                                              ║
║  Automation for migrating Amplify applications from          ║
║           Gen1 to Gen2                                       ║
║                                                              ║
╚══════════════════════════════════════════════════════════════╝

[2026-01-05T21:17:18.706Z] [INFO]  Detecting execution environment...
[2026-01-05T21:17:18.707Z] [INFO]  Detected environment: local
[2026-01-05T21:17:18.707Z] [INFO]  Environment: local
[2026-01-05T21:17:18.707Z] [INFO]  Selecting apps for migration...
[2026-01-05T21:17:18.710Z] [INFO]  Discovered 5 available apps: app-1, app-2, app-3, app-4, app-5
[2026-01-05T21:17:18.710Z] [INFO]  Selected apps: app-1
[2026-01-05T21:17:18.710Z] [INFO]  Selected 1 apps: app-1
[2026-01-05T21:17:18.711Z] [INFO]  Loading app configurations...
[2026-01-05T21:17:18.712Z] [INFO]  [app:app-1] Successfully loaded configuration for app-1
[2026-01-05T21:17:18.713Z] [INFO]  Loaded configuration for app-1
[2026-01-05T21:17:18.713Z] [INFO]  Starting app initialization...
[2026-01-05T21:17:18.713Z] [INFO]  Migration target directory: /Users/ianhou/workplace/amplify-cli2/amplify-migration-system/migration-output
[2026-01-05T21:17:18.713Z] [INFO]  Processing app 1/1: app-1
[2026-01-05T21:17:18.713Z] [INFO]  [app:app-1|op:initializeSingleApp] Starting initialization for app-1 with deployment name: e2e260105161718713
[2026-01-05T21:17:18.714Z] [INFO]  [app:e2e260105161718713|op:createAppDirectory] Creating app directory for e2e260105161718713
[2026-01-05T21:17:18.716Z] [INFO]  [app:e2e260105161718713|op:createAppDirectory] Successfully created app directory: /Users/ianhou/workplace/amplify-cli2/amplify-migration-system/migration-output/e2e260105161718713
[2026-01-05T21:17:18.716Z] [INFO]  [app:app-1|op:initializeSingleApp] Created target directory: /Users/ianhou/workplace/amplify-cli2/amplify-migration-system/migration-output/e2e260105161718713
[2026-01-05T21:17:18.717Z] [INFO]  [app:app-1|op:initializeSingleApp] Copying source directory to target...
[2026-01-05T21:17:18.717Z] [INFO]  [op:copyDirectory] Copying directory: /Users/ianhou/workplace/amplify-cli2/amplify-migration-apps/app-1 -> /Users/ianhou/workplace/amplify-cli2/amplify-migration-system/migration-output/e2e260105161718713
[2026-01-05T21:17:18.742Z] [INFO]  [op:copyDirectory] Successfully copied directory: /Users/ianhou/workplace/amplify-cli2/amplify-migration-apps/app-1 -> /Users/ianhou/workplace/amplify-cli2/amplify-migration-system/migration-output/e2e260105161718713
[2026-01-05T21:17:18.743Z] [INFO]  [app:app-1|op:initializeSingleApp] Successfully copied source directory
[2026-01-05T21:17:18.743Z] [INFO]  [app:app-1|op:initializeSingleApp] Running amplify init in /Users/ianhou/workplace/amplify-cli2/amplify-migration-system/migration-output/e2e260105161718713
[2026-01-05T21:17:18.743Z] [INFO]  [app:e2e260105161718713|op:initializeApp] Starting amplify init for e2e260105161718713 (config: app-1)
[2026-01-05T21:17:18.744Z] [INFO]  [app:e2e260105161718713|op:initializeApp] Calling initJSProjectWithProfile...
[2026-01-05T21:17:58.284Z] [INFO]  [app:e2e260105161718713|op:initializeApp] Successfully initialized Amplify app: e2e260105161718713 (took 39540ms)
[2026-01-05T21:17:58.285Z] [INFO]  Successfully initialized app-1

=== INITIALIZATION RESULTS ===

Total apps processed: 1
Successful: 1
Failed: 0

e2e260105161718713: ✓ SUCCESS (39.57s)
  Path: /Users/ianhou/workplace/amplify-cli2/amplify-migration-system/migration-output/e2e260105161718713

=== END INITIALIZATION RESULTS ===

[2026-01-05T21:17:58.285Z] [INFO]  App initialization completed successfully
[2026-01-05T21:17:58.285Z] [INFO]  Stopping before category processing as per current implementation scope

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

@iankhou iankhou added the migration-issue Issues tied to migration of the project between major CLI versions label Jan 5, 2026
@iankhou iankhou changed the title Iankhou gen2 migration e2e feat: amplify-migration-system executes e2e flow for amplify init, using atmosphere credentials Jan 5, 2026
@iankhou iankhou changed the title feat: amplify-migration-system executes e2e flow for amplify init, using atmosphere credentials feat(gen2-migration): amplify-migration-system executes e2e flow for amplify init, using atmosphere credentials Jan 5, 2026
@iankhou iankhou marked this pull request as ready for review January 5, 2026 17:03
@iankhou iankhou requested a review from a team as a code owner January 5, 2026 17:03
@iankhou iankhou marked this pull request as draft January 5, 2026 17:19
@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch from 90354e5 to 1f9b29d Compare January 5, 2026 17:33
@iankhou iankhou changed the title feat(gen2-migration): amplify-migration-system executes e2e flow for amplify init, using atmosphere credentials feat(gen2-migration): amplify-migration-system executes e2e flow for amplify init, using atmosphere credentials or local profile Jan 5, 2026
@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch from 85c1a83 to 7efef77 Compare January 5, 2026 21:39
@iankhou iankhou marked this pull request as ready for review January 5, 2026 21:39
@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch from 7efef77 to 4b26f42 Compare January 6, 2026 21:13
@iankhou iankhou removed the migration-issue Issues tied to migration of the project between major CLI versions label Jan 6, 2026
@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch 2 times, most recently from b93919f to da4c3ca Compare January 7, 2026 16:11
@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

Rename to amplify-migration-e2e-system
Move to packages/ directory

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

Rename package.json task dev -> migrate

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

Don't use require(), use import instead. clean up all mocks using jest resetAllMocks

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

Add necessary logs from nexpect to dumpfile

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

deleteAmplifyApp should wait until resources are deleted. poll until root stack is gone. aws sdk, import sdk cloudformation client called waitforstackstatus, deleted.

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

default to default profile in the CLI.

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

directory manager integration test doesn't need to be named integration test. only if it does a network call.

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

make the suffix of the deployed app names similar to the amplify-migration-apps name

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

Remove verify-app validation.

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

Remove validations from list-apps

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

some apps are not neccesarily react, parameterize this.

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

make profile argument required.

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

for atmosphere flow, create a profile with session token, config and credentials files

@iankhou
Copy link
Contributor Author

iankhou commented Jan 7, 2026

remove multi-app deployment functionality, make it take a single app.

@iankhou iankhou marked this pull request as draft January 7, 2026 22:45
@iankhou
Copy link
Contributor Author

iankhou commented Jan 12, 2026

some apps are not neccesarily react, parameterize this.

This is now configurable in migration-config.json, under app.framework.

@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch from 1680e87 to 56a4e2f Compare January 12, 2026 22:08
@iankhou
Copy link
Contributor Author

iankhou commented Jan 14, 2026

default to default profile in the CLI.

Made it required. Either --profile or --atmosphere must be indicated.

@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch from 9ec3f41 to 147cb3c Compare January 14, 2026 16:42
@iankhou iankhou marked this pull request as ready for review January 14, 2026 18:16
.wait('Select the authentication method you want to use:')
.sendCarriageReturn()
.wait('Please choose the profile you want to use')
.sendLine(s.profileName);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was as bug in the original code, that was unused. Sending profile name in this way did not select the expected profile, as it is not a typed input. It is only a selection via up/down arrow keys.

return chain(context);
},
sendKeyDown(repeat?: number): ExecutionContext {
const repetitions = repeat ? Math.max(1, repeat) : 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally, the repeat parameter would lead to the following behavior:

  • When 0, send key down 1 time
  • When 1, send key down 1 time
  • When -1, send key down 1 time

This has been changed such that the number of times we "send key down" corresponds to the number of the param. It errors on 0 or less.

return chain(context);
},
sendKeyUp(repeat?: number): ExecutionContext {
const repetitions = repeat ? Math.max(1, repeat) : 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar situation to sendKeyDown.

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.

1 participant