Skip to content

feat(gen2-migration): amplify-migration-system executes e2e flow for amplify init, using atmosphere credentials or local profile#14432

Merged
iliapolo merged 5 commits intogen2-migrationfrom
iankhou-gen2-migration-e2e
Feb 10, 2026
Merged

feat(gen2-migration): amplify-migration-system executes e2e flow for amplify init, using atmosphere credentials or local profile#14432
iliapolo merged 5 commits intogen2-migrationfrom
iankhou-gen2-migration-e2e

Conversation

@iankhou
Copy link
Copy Markdown
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.

Using Atmosphere is only supported in CI, or by developers in the team with the correct permissions. You must have a .gamma.env file with properly configured variables according to the README IN ADDITION to permissions on your AWS account.

You must specify a profile using --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.

Ran a local deployment using a profile with AmplifyAdmin IAM permissions. See log example at the end.

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

Note that I manually set my amplify binary, as I was using the CLI built by the monorepo during development and don't have Amplify CLI installed globally. If you do, you may just run something like:

yarn migrate --app project-boards --profile amplify1
$ export AMPLIFY_PATH=/Users/ianhou/workplace/amplify-cli/.bin/amplify-dev && yarn migrate --app project-boards --profile amplify1


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

[2026-02-10T00:08:28.059Z] [INFO]  Local environment detected - will use local AWS profile: amplify1 for credentials
[2026-02-10T00:08:28.064Z] [INFO]  Discovered 6 available apps: discussions, fitness-tracker, media-vault, product-catalog, project-boards, project-boards-backend-only
[2026-02-10T00:08:28.065Z] [INFO]  Selected app: project-boards
[2026-02-10T00:08:28.065Z] [INFO]  File logging set: /var/folders/zy/p394g9w14sbbfwj23q2pd3f00000gq/T/amplify-gen2-migration-e2e-system/logs/260209190828065ards.log
[2026-02-10T00:08:28.067Z] [INFO]  [app:project-boards] Successfully loaded configuration for project-boards
[2026-02-10T00:08:28.067Z] [INFO]  [app:project-boards|op:initializeApp] Starting initialization for project-boards with deployment name: 260209190828065ards
[2026-02-10T00:08:28.068Z] [INFO]  [app:260209190828065ards|op:createAppDirectory] Creating app directory for 260209190828065ards
[2026-02-10T00:08:28.069Z] [INFO]  [app:260209190828065ards|op:createAppDirectory] Successfully created app directory: /var/folders/zy/p394g9w14sbbfwj23q2pd3f00000gq/T/amplify-gen2-migration-e2e-system/output-apps/260209190828065ards
[2026-02-10T00:08:28.100Z] [INFO]  [app:260209190828065ards|op:initializeApp] Starting amplify init for 260209190828065ards (config: project-boards)
[2026-02-10T00:09:09.216Z] [INFO]  [app:260209190828065ards|op:initializeApp] Successfully initialized Amplify app in /var/folders/zy/p394g9w14sbbfwj23q2pd3f00000gq/T/amplify-gen2-migration-e2e-system/output-apps/260209190828065ards, 260209190828065ards (took 41115ms)
[2026-02-10T00:09:09.217Z] [INFO]  Stopping before category processing as per current implementation scope

Related to #14537

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
Comment thread packages/amplify-gen2-migration-e2e-system/src/utils/logger.ts Fixed
Comment thread amplify-migration-system/src/core/AmplifyInitializer.ts Fixed
@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
Comment thread amplify-migration-system/src/utils/DirectoryManager.ts Fixed
@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
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

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

@iankhou
Copy link
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

Rename package.json task dev -> migrate

@iankhou
Copy link
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

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

@iankhou
Copy link
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

Add necessary logs from nexpect to dumpfile

@iankhou
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

default to default profile in the CLI.

@iankhou
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

Remove verify-app validation.

@iankhou
Copy link
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

Remove validations from list-apps

@iankhou
Copy link
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

some apps are not neccesarily react, parameterize this.

@iankhou
Copy link
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

make profile argument required.

@iankhou
Copy link
Copy Markdown
Contributor Author

iankhou commented Jan 7, 2026

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

@iankhou
Copy link
Copy Markdown
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
Comment thread amplify-migration-system/src/__tests__/amplify-initializer.test.ts Fixed
Comment thread amplify-migration-system/src/__tests__/amplify-initializer.test.ts Fixed
Comment thread amplify-migration-system/src/__tests__/amplify-initializer.test.ts Fixed
Comment thread amplify-migration-system/src/__tests__/amplify-initializer.test.ts Fixed
@iankhou
Copy link
Copy Markdown
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
Comment thread packages/amplify-migration-e2e-system/dist/types/index.js Fixed
Comment thread packages/amplify-migration-e2e-system/dist/types/index.js Fixed
Comment thread packages/amplify-migration-e2e-system/dist/types/index.js Fixed
@iankhou
Copy link
Copy Markdown
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
Comment thread packages/amplify-e2e-core/src/init/initProjectHelper.ts
Comment thread packages/amplify-e2e-core/src/utils/nexpect.ts
Comment thread packages/amplify-e2e-core/src/utils/nexpect.ts
@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch 3 times, most recently from c9f860d to 11b4d7f Compare February 9, 2026 19:03
@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch from 11b4d7f to fac5202 Compare February 9, 2026 22:13
Comment thread packages/amplify-gen2-migration-e2e-system/src/utils/logger.ts Fixed
@iankhou iankhou force-pushed the iankhou-gen2-migration-e2e branch from 745deb1 to 0a07d1c Compare February 9, 2026 23:56
iankhou and others added 2 commits February 10, 2026 09:00
… property

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@iliapolo iliapolo enabled auto-merge (squash) February 10, 2026 15:13
@iliapolo iliapolo merged commit e43265d into gen2-migration Feb 10, 2026
4 checks passed
@iliapolo iliapolo deleted the iankhou-gen2-migration-e2e branch February 10, 2026 15:15
dgandhi62 pushed a commit that referenced this pull request Feb 19, 2026
…amplify init, using atmosphere credentials or local profile (#14432)

* migration configs

* enhancements to existing utils

* amplify-gen2-migration-e2e-system

* Potential fix for code scanning alert no. 2087: Useless assignment to property

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* readme update

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

3 participants