chore(gen2-migration): e2e fixes#14771
Merged
iliapolo merged 9 commits intogen2-migrationfrom Apr 10, 2026
Merged
Conversation
…and add gen2-migration skill Move sanitize and snapshot capture logic into the e2e-system package so that sanitization runs automatically as part of the E2E flow. Simplify the migration-apps sanitize.ts and snapshot.ts to delegate to the shared implementation. Add a gen2-migration development skill with context references and a development loop for bug fixes and new features. Minor fixes to gitignore generator and refactor output directory. --- Prompt: we are working on the gen2-migration skill and e2e snapshot capture improvements
Streamline the gen2-migration skill with structured Context and Development Loop sections covering bug fix and feature workflows. Add missing E2E snapshot capture step to "Adding an App" and "Modifying an App" sections in the migration apps README. --- Prompt: refine the gen2-migration skill and fix missing E2E step in migration apps README
Remove git wrapper methods and call this.git.* directly. Move migrate() next to the other migration methods. Reorganize class sections (Tests, Hooks). Filter updateSnapshots to only copy _snapshot directories. --- Prompt: commit
Add deploy npm script to all migration apps. Fix snapshot.ts usage string and README to match new argument signature. Add JSDoc to new public members. Update PR template headings to h3. Update AGENTS.md PR body instructions with grouping guidance. --- Prompt: add deploy script to all apps, check for outdated docstrings, update PR template and AGENTS.md
…o e2e refactor flow Add cross-generation data validation tests that verify stateful resources (Cognito, AppSync/DynamoDB, S3) are correctly shared between gen1 and gen2 after migration refactor. Changes: - New shared-data.test.ts for discussions app that tests both gen1→gen2 and gen2→gen1 data access for auth, API, activity tables, and storage. - Generalize post-refactor script: extract addTableNameToTable helper, add bookmarks table support, add uncommentS3BucketName. - Make configureAmplify() lazy so tests can switch between gen1 and gen2 configs at runtime. - Propagate ENV_NAME env var from e2e system to migration scripts instead of using default parameter values. - Add testSharedData step to the e2e deploy phase. - Make Git.run public so App can cherry-pick files across branches. --- Prompt: commit everything
… to all migration apps
Add a no-op test:shared-data script ("true") to every migration app
that doesn't already have one. This ensures the e2e system can
uniformly call the script across all apps without failures. Real
tests will be added per-app later.
---
Prompt: Add a "test:shared-data" script to all migration apps,
have it just be "true" for now, we'll add tests later.
…ow docs Update gen2-migration SKILL.md to clarify snapshot directory inspection and to guide the agent to check for existing test app coverage before fixing a bug. Update amplify-migration-apps README.md to include validation test steps when adding or modifying apps, and note that E2E failures require fixing the bug before snapshots can be captured. --- Prompt: made more changes. commit.
…k and analytics test Add post-push.ts for mood-board that updates KINESIS_STREAM_NAME in src/constants.ts to match the deployed environment. Add a Kinesis record/read test in analytics.test.ts that writes events and polls getKinesisEvents to verify at least one is readable. Move the getKinesisEvents parseable JSON test from analytics to api.test.ts. Fix env name generation to always use length 10. --- Prompt: made more changes. commit everything.
dgandhi62
approved these changes
Apr 10, 2026
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.
Description of changes
After the refactor step, the discussion app now validates that stateful resources (Cognito user pool,
AppSync/DynamoDB tables, S3 bucket) are actually shared between gen1 and gen2 configurations. This
catches regressions where a refactor silently creates new resources instead of reusing existing ones.
The new
shared-datatest suite writes data through one generation's configand reads it back through the other, in both directions (gen1→gen2 and gen2→gen1). It covers auth,
API/data, DynamoDB activity table, and S3 storage.
To support this,
configureAmplify()was made lazy so tests can switch between gen1 and gen2 configsat runtime, and migration scripts now receive
ENV_NAMEvia environment variable instead of positionalargument defaults.
ENV_NAME propagation
Migration scripts (discussions
post-refactor, mood-boardpost-generateandpost-refactor) nolonger accept
envNameas a positional CLI arg with a default. Instead they readENV_NAMEfrom theenvironment, which the e2e system now sets automatically. This removes the risk of silently using the
wrong environment name.
Discussions post-refactor enhancements
Generalized
addTableNameToActivityTableintoaddTableNameToTableto support both the activity andbookmarks DynamoDB tables. Added
uncommentS3BucketNameto preserve the original bucket name duringrefactor.
Mood-board post-push hook and analytics test
New
post-push.tsfor mood-board that updatesKINESIS_STREAM_NAMEinsrc/constants.tsto matchthe deployed environment name. The analytics test suite now records events to the Kinesis stream and
polls
getKinesisEventsto verify at least one event is readable. ThegetKinesisEventsparseableJSON test was moved from analytics to api.test.ts where it fits better alongside the other auth-gated
query tests.
Docs
Updated
amplify-migration-apps/README.mdto include validation test steps when adding or modifyingapps, and note that E2E failures require fixing the bug before snapshots can be captured. Updated
gen2-migration SKILL.md to clarify snapshot directory inspection and guide coverage checks before
fixing bugs.
Issue #, if available
N/A
Description of how you validated changes
yarn buildpasses inpackages/amplify-gen2-migration-e2e-systemChecklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.