Skip to content

feat(gen2-migration): add e2e support for the mood-board app#14693

Merged
iankhou merged 37 commits intoiankhou-gen2-migration-e2e-categoriesfrom
dgandhi62-gen2-migration-e2e-mediavault
Mar 25, 2026
Merged

feat(gen2-migration): add e2e support for the mood-board app#14693
iankhou merged 37 commits intoiankhou-gen2-migration-e2e-categoriesfrom
dgandhi62-gen2-migration-e2e-mediavault

Conversation

@dgandhi62
Copy link
Copy Markdown
Contributor

@dgandhi62 dgandhi62 commented Mar 19, 2026

Changes Made

Analytics category support

Added end-to-end support for the Amplify analytics category (Kinesis Data Streams).

e2e-core: addKinesisStream helper

packages/amplify-e2e-core/src/categories/analytics.ts

Added a new addKinesisStream(cwd, { name, shards? }) helper. The existing addKinesis helper requires a wrongName/rightName pair for input validation testing, which doesn't fit the migration system's use case. The new helper takes a stream name and optional shard count directly.

Type: AnalyticsConfiguration

packages/amplify-gen2-migration-e2e-system/src/types/index.ts

  • Added AnalyticsConfiguration interface with type (kinesis | pinpoint), name, and optional shards.
  • Added analytics? field to CategoryConfiguration.

Validation

packages/amplify-gen2-migration-e2e-system/src/core/configuration-loader.ts

Added validateAnalyticsConfiguration — requires type to be kinesis or pinpoint, and name to be present.

Category initialization

packages/amplify-gen2-migration-e2e-system/src/core/category-initializer.ts

  • Added initializeAnalyticsCategory method with Kinesis stream support. Pinpoint is recognized but not yet implemented.
  • Analytics is initialized after auth but before functions, since functions like moodboardKinesisReader may reference analytics resources.

Config docs

packages/amplify-gen2-migration-e2e-system/MIGRATION_CONFIG.md

Documented the analytics category schema, fields, and validation rules.

mood-board migration config

amplify-migration-apps/mood-board/migration-config.json

Created the migration config for the mood-board app with all its categories: auth (email), api (GraphQL with API_KEY + COGNITO_USER_POOLS, custom queries), storage (S3 with auth + guest), function (two Lambda functions), hosting, and analytics (Kinesis stream moodboardKinesis with 1 shard).

iankhou and others added 30 commits March 13, 2026 13:52
…ts, add function in e2e-core that allows email authentication
…prompt flow

When functions already exist in the project, the CLI shows an extra
"Select from the following options" prompt during S3 trigger setup.
Added optional projectHasFunctions flag to addS3WithTrigger and
updated category-initializer to pass it based on initialization state.
…gnito and IAM auth modes

When the schema uses owner rules (which implicitly require userPools),
the API must have Cognito User Pools configured as an auth provider.
Use addApi with requireAuthSetup=false to add the needed auth modes
without re-prompting for Cognito setup since auth is already initialized.
…less of requireAuthSetup

When requireAuthSetup is false, addApi skipped all auth type setup
including API key description/expiration prompts that the CLI always
shows. Now API key and IAM setup are always handled, while Cognito/OIDC
setup remains conditional on requireAuthSetup.
…ng doc

- Use addS3WithGroupAccess when auth has userPoolGroups to avoid
  Restrict-access-by prompt timeout during storage initialization
- Add TROUBLESHOOTING.md documenting known issues and solutions
addAuthWithGroups creates hardcoded Admins/Users
groups, so addS3WithGroupAccess must use those
defaults instead of config values.
- Add addKinesisStream helper in amplify-e2e-core
- Add AnalyticsConfiguration type, validation, and
  category initialization with Kinesis support
- Create mood-board migration-config.json
- Add CHANGELOG.md documenting all recent changes
@dgandhi62 dgandhi62 requested a review from a team as a code owner March 19, 2026 17:50
@dgandhi62 dgandhi62 force-pushed the dgandhi62-gen2-migration-e2e-mediavault branch from cc40740 to 2fa7ed1 Compare March 19, 2026 17:52
@iankhou iankhou merged commit 7fedb1b into iankhou-gen2-migration-e2e-categories Mar 25, 2026
4 checks passed
@iankhou iankhou deleted the dgandhi62-gen2-migration-e2e-mediavault branch March 25, 2026 15:56
iankhou added a commit that referenced this pull request Mar 27, 2026
* chore: programmatic migration configs

* feat: automated migration, first commit

* feat: amplify-migration-e2e-system

* yarn.lock update

* test setup ts errors

* yarn.lock update

* added dependency to e2e core package in amplify-migration-system

* review changes

* fix: review changes

* remove extra code

* feat: add category initializer and update MIGRATION_CONFIG requirements, add function in e2e-core that allows email authentication

* update migration configs

* category initialization and amplify push

* set random Amplify envName by default, to avoid lambda name collisions

* remove excess dependency: tsx

* test update: AmplifyInitializer

* feat(gen2-migration): gen2-migration lock and generate steps

* yarn lockfile

* chore: add troubleshooting doc & only test uptill before lock

* fix(amplify-e2e-core): handle existing functions in addS3WithTrigger prompt flow

When functions already exist in the project, the CLI shows an extra
"Select from the following options" prompt during S3 trigger setup.
Added optional projectHasFunctions flag to addS3WithTrigger and
updated category-initializer to pass it based on initialization state.

* fix(amplify-gen2-migration-e2e-system): configure GraphQL API with Cognito and IAM auth modes

When the schema uses owner rules (which implicitly require userPools),
the API must have Cognito User Pools configured as an auth provider.
Use addApi with requireAuthSetup=false to add the needed auth modes
without re-prompting for Cognito setup since auth is already initialized.

* fix(amplify-e2e-core): always handle API key prompts in addApi regardless of requireAuthSetup

When requireAuthSetup is false, addApi skipped all auth type setup
including API key description/expiration prompts that the CLI always
shows. Now API key and IAM setup are always handled, while Cognito/OIDC
setup remains conditional on requireAuthSetup.

* chore: remove troubleshooting file

* chore: reset yarn lock

* chore: reset yarn lock

* chore: remove fitness-tracker not part of this PR

* chore: reset

* chore: comment midpoint

* chore: reset yarn lock to gen2-migration branch

* feat: allow dynamodb storage resource

* chore: remove unnecessary code

* fix: handle user pool groups in S3 storage init and add troubleshooting doc

- Use addS3WithGroupAccess when auth has userPoolGroups to avoid
  Restrict-access-by prompt timeout during storage initialization
- Add TROUBLESHOOTING.md documenting known issues and solutions

* fix: use default group names for S3 group access

addAuthWithGroups creates hardcoded Admins/Users
groups, so addS3WithGroupAccess must use those
defaults instead of config values.

* chore: remove unnecessary files

* feat: add analytics category support and mood-board config

- Add addKinesisStream helper in amplify-e2e-core
- Add AnalyticsConfiguration type, validation, and
  category initialization with Kinesis support
- Create mood-board migration-config.json
- Add CHANGELOG.md documenting all recent changes

* chore: remove unnecessary files

---------

Co-authored-by: Ian Hou <45278651+iankhou@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.

2 participants