Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
22913fe
fix(amplify-gen2-migration-e2e-system): initialize DynamoDB tables al…
iliapolo Apr 2, 2026
3e2819d
refactor(amplify-gen2-migration-e2e-system): simplify e2e migration s…
iliapolo Apr 3, 2026
ec21836
refactor: restructure discussions app and consolidate docs
iliapolo Apr 3, 2026
6b7ad16
refactor: restructure all remaining migration apps
iliapolo Apr 3, 2026
ba099ba
refactor: inline generateClient in frontest test functions
iliapolo Apr 3, 2026
4100b0a
refactor: add migration config and fix fitness-tracker e2e
iliapolo Apr 3, 2026
3e78a2b
chore: remove cleanup scripts
iliapolo Apr 3, 2026
7c4c67a
refactor: hardcode frontest.ts and simplify migration config
iliapolo Apr 3, 2026
9762d94
docs: document migration config and automatic script execution
iliapolo Apr 3, 2026
f9458be
refactor: auto-detect post-* scripts by file existence
iliapolo Apr 3, 2026
6608ee4
refactor(amplify-gen2-migration-e2e-system): extract AppScriptExecutor
iliapolo Apr 3, 2026
d3c71b7
refactor(amplify-gen2-migration-e2e-system): consolidate into App class
iliapolo Apr 4, 2026
cd716d2
refactor(amplify-gen2-migration-e2e-system): centralize logging in he…
iliapolo Apr 4, 2026
0d162a6
chore: remove export files
iliapolo Apr 4, 2026
462e6c5
refactor: improve e2e system and fix display formatting
iliapolo Apr 4, 2026
b7bf9c2
refactor(fitness-goal-tracker): replace frontest.ts with Jest tests
iliapolo Apr 4, 2026
b60e8f8
refactor: replace frontest.ts scripts with Jest test suites
iliapolo Apr 4, 2026
f1a3612
refactor: expose migration scripts as npm scripts
iliapolo Apr 4, 2026
e643ace
chore(amplify-gen2-migration-e2e-system): remove redundant log lines …
iliapolo Apr 4, 2026
fc20240
chore: convert jest.config.ts to jest.config.js
iliapolo Apr 4, 2026
474f1f5
chore: add moduleFileExtensions and allowJs to jest configs, clean up…
iliapolo Apr 4, 2026
51837cb
refactor: restructure migration app tests by category
iliapolo Apr 4, 2026
65914eb
chore: fix guest storage tests and add private storage coverage
iliapolo Apr 4, 2026
4d1f93c
fix: repair corrupt test file, add missing scripts, fix ESM config
iliapolo Apr 4, 2026
1733b8b
chore: add test retries, fix error logging, remove glob dependency
iliapolo Apr 4, 2026
8e1f931
refactor: use dynamic branch resolution in post-generate scripts
iliapolo Apr 5, 2026
54e295b
refactor: automate remaining post-generate edits, simplify READMEs
iliapolo Apr 5, 2026
cc2eee2
fix(cli-internal): restore cursor on SIGINT during spinner
iliapolo Apr 5, 2026
c5ea58c
docs: update READMEs to reflect current e2e architecture
iliapolo Apr 5, 2026
acc3377
fix(cli-internal): use ExecuteChangeSet instead of UpdateStack
iliapolo Apr 5, 2026
4791d11
chore: update kiro mcp settings
iliapolo Apr 5, 2026
c23348e
feat(amplify-gen2-migration-e2e-system): automate remaining migration…
iliapolo Apr 5, 2026
04b6176
fix(product-catalog): remove apiKey auth from checkLowStock and fix S…
iliapolo Apr 5, 2026
e9232f2
fix(amplify-gen2-migration-e2e-system): e2e fixes for product-catalog…
iliapolo Apr 6, 2026
185adf5
fix(media-vault): strip social providers from auth config in post-gen…
iliapolo Apr 6, 2026
a7f2c3d
fix(cli-internal): update test mocks for executeChangeSet refactor
iliapolo Apr 6, 2026
18f898f
chore: prettier formatting and dependency sorting in package.json files
iliapolo Apr 6, 2026
5ac9583
chore: remove test script from migration e2e
iliapolo Apr 6, 2026
aa9dc42
fix(media-vault): monkey-patch auth secret() with local plaintext values
iliapolo Apr 6, 2026
b6e9970
chore: code review
iliapolo Apr 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslint-dictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"formatter",
"frontend",
"frontends",
"frontest",
"fsext",
"func",
"funcs",
Expand Down
71 changes: 36 additions & 35 deletions .kiro/settings/mcp.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
{
"mcpServers": {
"aws-infrastructure-as-code": {
"command": "uvx",
"args": [
"awslabs.aws-iac-mcp-server@latest"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
},
"disabled": false,
"autoApprove": [
"search_cdk_documentation",
"search_cdk_samples_and_constructs",
"search_cloudformation_documentation",
"cdk_best_practices",
"read_iac_documentation_page"
]
},
"aws-mcp": {
"command": "uvx",
"timeout": 100000,
"transport": "stdio",
"args": [
"mcp-proxy-for-aws@latest",
"https://aws-mcp.us-east-1.api.aws/mcp",
"--metadata"
],
"disabled": false,
"autoApprove": [
"search_documentation",
"list_regions",
"get_regional_availability"
]
}
"mcpServers": {
"aws-infrastructure-as-code": {
"command": "uvx",
"args": [
"awslabs.aws-iac-mcp-server@latest"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
},
"disabled": false,
"autoApprove": [
"search_cdk_documentation",
"search_cdk_samples_and_constructs",
"search_cloudformation_documentation",
"cdk_best_practices",
"read_iac_documentation_page"
]
},
"aws-mcp": {
"command": "uvx",
"timeout": 100000,
"transport": "stdio",
"args": [
"mcp-proxy-for-aws@latest",
"https://aws-mcp.us-east-1.api.aws/mcp",
"--metadata"
],
"disabled": false,
"autoApprove": [
"search_documentation",
"list_regions",
"get_regional_availability",
"aws___search_documentation"
]
}
}
}
}
114 changes: 111 additions & 3 deletions amplify-migration-apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ Each app directory follows this layout:

```
<app-name>/
├── backend/ # Backend assets (schema, function code, configure.sh)
├── migration/
│ ├── config.json # E2E system configuration (optional)
│ ├── post-generate.ts # Fixups after gen2-migration generate
│ ├── post-push.ts # Fixups after amplify push (optional)
│ └── post-refactor.ts # Fixups after gen2-migration refactor
├── tests/ # Jest test suites for validating deployed stacks
│ ├── signup.ts # Cognito user provisioning (app-specific)
│ ├── jest.setup.ts # Jest setup (retry config)
│ ├── api.test.ts # GraphQL / REST API tests
│ ├── storage.test.ts # S3 / DynamoDB storage tests
│ └── ... # Additional category-specific test files
├── jest.config.js # Jest configuration
├── _snapshot.pre.generate/ # Input for `gen2-migration generate` test (Gen1 app state)
├── _snapshot.post.generate/ # Expected output of `gen2-migration generate`
├── _snapshot.pre.refactor/ # Input for `gen2-migration refactor` test (CFN templates)
Expand All @@ -30,17 +43,81 @@ Each app directory follows this layout:
├── .gitignore # Git ignore rules
├── package.json # Standard NodeJS based manifest
├── README.md # Deployment and migration instructions
└── ... # App-specific source files (schema, configs, etc.)
└── ... # App-specific source files
```

The Gen1 Amplify project structure (the `amplify/` directory) lives inside
`_snapshot.pre.generate/`, not at the top level. The top level only contains
snapshot directories, the app manifest, and any source files needed for
deployment (e.g., `schema.graphql`, `configure.sh`).
snapshot directories, the app manifest, and source files needed for deployment.

### `backend/`

Contains the backend source assets for the app: the GraphQL schema, Lambda function code,
and a `configure.sh` script that copies them into the Gen1 `amplify/` directory structure.
The configure script uses `$BASH_SOURCE`-relative paths so it works regardless of the
caller's working directory.

### `migration/config.json`

Configuration file read by the [E2E system](../packages/amplify-gen2-migration-e2e-system/) at runtime.
Currently supports:

```json
{
"lock": { "skipValidations": true }
}
```

- `lock.skipValidations` — pass `--skip-validations` to `gen2-migration lock`.

If the file does not exist, defaults are used (no skip-validations).

### `tests/`

Jest test suites that validate a deployed stack. Each app has its own `jest.config.js` and
test files under `tests/`. The config path is controlled by the `APP_CONFIG_PATH` environment
variable, which the `test:gen1` and `test:gen2` npm scripts set to the appropriate file
(`src/amplifyconfiguration.json` for Gen1, `amplify_outputs.json` for Gen2).

Each app has its own `tests/signup.ts` that handles Cognito user provisioning via
`AdminCreateUser` + `AdminSetUserPassword`, tailored to the app's specific auth
configuration (email vs phone sign-in, user pool groups, etc.).

### `migration/post-generate.ts` and `migration/post-refactor.ts`

Optional scripts that apply app-specific fixups the migration CLI cannot automate. Examples:

- Converting CommonJS Lambda functions to ESM syntax
- Updating frontend imports from `aws-exports` to `amplify_outputs.json`
- Setting `branchName` to `sandbox` for DynamoDB table mappings
- Uncommenting resource names to preserve original Gen1 names after refactor

Both scripts export a function and accept `appPath` as a CLI argument:

```typescript
export async function postGenerate(appPath: string): Promise<void>;
export async function postRefactor(appPath: string): Promise<void>;
```

If a script does not exist for an app, the E2E system silently skips the step.

> Some apps don't have `_snapshot.post.refactor/` because refactor doesn't work
> for them yet.

### `migration/pre-push.ts` and `migration/post-sandbox.ts`

Optional scripts for additional lifecycle hooks:

- `pre-push.ts` — runs before `amplify push`. Use for fixups that require the Amplify
app to be initialized but not yet deployed (e.g., substituting the real Amplify app ID
into configuration files).
- `post-sandbox.ts` — runs after the first `npx ampx sandbox --once` deploy. Use for
fixups that require the Gen2 stack to exist (e.g., writing secrets to SSM Parameter
Store using the deployed stack name).

Both accept `appPath` as a CLI argument. If a script does not exist for an app, the
E2E system silently skips the step.

### `_snapshot.pre.generate/`

A copy of the Gen1 app as it exists before running `gen2-migration generate`. This is the
Expand Down Expand Up @@ -349,3 +426,34 @@ Always review the diff after updating to make sure the changes are intentional.
> because it detects the diff before writing the updated files. Run the tests a second time
> (without `--updateSnapshot`) to verify the snapshots are now correct.


## Integration Testing (E2E)

The [E2E system](../packages/amplify-gen2-migration-e2e-system/) automates the full migration
workflow for a single app: Gen1 deploy, migration, Gen2 deploy, and validation at each stage.
It deploys real AWS resources, so you need valid credentials.

```bash
# Build the Amplify CLI (if using the development binary)
cd packages/amplify-cli && yarn build

# Optionally point to your dev CLI (falls back to monorepo build, then global install)
export AMPLIFY_PATH=$(pwd)/.bin/amplify-dev

# Run the full migration for a specific app
cd packages/amplify-gen2-migration-e2e-system
npx tsx src/cli.ts --app project-boards --profile default
```

This will:
1. Deploy the Gen1 app via `amplify push`
2. Run `test:gen1` to validate the Gen1 stack
3. Execute the full `gen2-migration` workflow (assess, lock, generate, deploy, refactor, redeploy)
4. Run `test:gen1` and `test:gen2` after each deployment

The system automatically runs npm scripts from the app's `package.json` at the right
points in the workflow — `post-generate` after generate, `post-refactor` after refactor,
and `post-push` after push. Scripts that resolve to `true` (no-op) are effectively skipped.

See the [E2E system README](../packages/amplify-gen2-migration-e2e-system/README.md) for
CLI options and troubleshooting.
21 changes: 0 additions & 21 deletions amplify-migration-apps/_test-common/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions amplify-migration-apps/_test-common/package.json

This file was deleted.

61 changes: 0 additions & 61 deletions amplify-migration-apps/_test-common/runner.ts

This file was deleted.

Loading
Loading