Skip to content

Commit 8ec55c5

Browse files
iankhoudependabot[bot]aws-amplify-bototaviomacedoiliapolo
authored
chore(gen2-migration): merge from dev, integrate gen2-migration into existing CLI (#14802)
* chore(deps): bump node-forge from 1.3.1 to 1.3.3 (#14382) Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.3.1 to 1.3.3. - [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md) - [Commits](digitalbazaar/forge@v1.3.1...v1.3.3) --- updated-dependencies: - dependency-name: node-forge dependency-version: 1.3.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump validator from 13.7.0 to 13.15.23 (#14378) Bumps [validator](https://github.com/validatorjs/validator.js) from 13.7.0 to 13.15.23. - [Release notes](https://github.com/validatorjs/validator.js/releases) - [Changelog](https://github.com/validatorjs/validator.js/blob/master/CHANGELOG.md) - [Commits](validatorjs/validator.js@13.7.0...13.15.23) --- updated-dependencies: - dependency-name: validator dependency-version: 13.15.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump js-yaml from 4.1.0 to 4.1.1 (#14359) Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.1.0...4.1.1) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump js-yaml from 4.1.0 to 4.1.1 in /scripts (#14343) Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.1.0...4.1.1) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump glob from 11.0.2 to 11.1.0 (#14352) * chore(deps): bump glob from 11.0.2 to 11.1.0 Bumps [glob](https://github.com/isaacs/node-glob) from 11.0.2 to 11.1.0. - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](isaacs/node-glob@v11.0.2...v11.1.0) --- updated-dependencies: - dependency-name: glob dependency-version: 11.1.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * chore: manual intervention --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: aws-amplify-bot <aws@amazon.com> * chore: upgrade dependencies * chore: fix gen2-migration release workflow (#14448) chore: mid work * ci: add explicit permissions to GitHub Actions workflows (#14449) * chore: scope down permissions for closed-issue-message.yml * chore: scope down permissions for build-test-mac.yml * chore: scope down permissions for release-gen2-migration.yml --------- Co-authored-by: Sai Ray <saisujit@amazon.com> * chore: update `node-gyp`, `node-pty`, and windows container (#14468) chore: update node-gyp, node-pty, and windows container Co-authored-by: aws-amplify-bot <aws@amazon.com> * fix mac smoke tests (#14509) * chore: mac is special * chore: new macs * chore: ensure mac has permissions * chore: revert shell changes * chore: update iOS --------- Co-authored-by: aws-amplify-bot <aws@amazon.com> * chore(release): Publish latest - @aws-amplify/cli-internal@14.2.4 - @aws-amplify/cli@14.2.4 - @aws-amplify/amplify-console-integration-tests@2.11.29 - @aws-amplify/amplify-container-hosting@2.8.24 - @aws-amplify/amplify-e2e-core@5.7.10 - amplify-e2e-tests@4.11.14 - @aws-amplify/amplify-migration-tests@6.5.11 - @aws-amplify/amplify-util-mock@5.10.26 - @aws-amplify/amplify-util-uibuilder@1.14.25 * fix: unsanitized input in pem file content handler (#14508) Replaced the use of `execSync` with `spawnSync` and parameterized input strings to prevent shell command injection. Removed the use of `$TSAny` in the file. Added unit tests. * fix: errant certificate mark handling (#14514) * chore(release): Publish latest - @aws-amplify/amplify-category-notifications@2.26.42 - @aws-amplify/cli-internal@14.2.5 - @aws-amplify/cli@14.2.5 - amplify-e2e-tests@4.11.15 * chore(deps): bump tar from 6.2.1 to 7.5.4 (#14502) Bumps [tar](https://github.com/isaacs/node-tar) from 6.2.1 to 7.5.4. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v6.2.1...v7.5.4) --- updated-dependencies: - dependency-name: tar dependency-version: 7.5.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: provide a link to the Gen2 migration tool in Gen2 banner (#14533) * Update migration guidance for Gen 1 customers Encourage Gen 1 customers to test migration tool for Gen 2. * Revise migration instructions for Gen 1 customers Updated wording for migration guidance from Gen 1 to Gen 2. * chore(deps): bump basic-ftp from 5.0.3 to 5.2.0 Bumps [basic-ftp](https://github.com/patrickjuchli/basic-ftp) from 5.0.3 to 5.2.0. - [Release notes](https://github.com/patrickjuchli/basic-ftp/releases) - [Changelog](https://github.com/patrickjuchli/basic-ftp/blob/master/CHANGELOG.md) - [Commits](patrickjuchli/basic-ftp@v5.0.3...v5.2.0) --- updated-dependencies: - dependency-name: basic-ftp dependency-version: 5.2.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump lodash from 4.17.21 to 4.17.23 (#14506) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump lodash-es from 4.17.21 to 4.17.23 (#14505) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash-es dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: resolve critical and high dependabot alerts (fast-xml-parser, tar, rollup) Adds yarn resolutions to upgrade transitive dependencies: - fast-xml-parser ~4.5.4 (CVE entity encoding bypass, DoS) - tar >=7.5.10 (path traversal, symlink poisoning) - rollup 2.80.0 (path traversal file write) * fix: bump aws-cdk-lib to 2.241.0 and constructs to 10.5.0 Fixes #14631 Upgrades aws-cdk-lib from ~2.189.1 to ~2.241.0 across the monorepo to resolve the minimatch ReDoS vulnerability (GHSA-3ppc-4f35-3m26, GHSA-7r86-cg39-jmmj, GHSA-23c5-xmqv-rm74). Also bumps constructs from ^10.0.5 to ^10.5.0 to satisfy the peer dependency requirement of the newer aws-cdk-lib. Fixes CfnManagedPolicy roles validation in consolidate-apigw-policies.ts by using CfnParameter.valueAsString instead of an unsafe type cast, which is required by the stricter validation in aws-cdk-lib 2.241.0. * chore: run yarn dedupe to fix CI verify_yarn_lock check * chore: run yarn dedupe to fix CI verify_yarn_lock check * fix: downgrade tar resolution to ^6.2.1 to fix lerna compatibility tar v7 removed tar.create() API which breaks lerna's packDirectory. CVE-2024-28863 is fixed in tar 6.2.1, so ^6.2.1 is safe. * chore(deps): bump minimatch from 3.0.4 to 3.1.5 in /scripts Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.0.4...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump minimatch from 3.1.2 to 3.1.4 Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.4. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.1.2...v3.1.4) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * fix: resolve high dependabot alerts (immutable, svgo, serialize-javascript) Fixes transitive dependency vulnerabilities: - immutable >=4.3.8 (prototype pollution) - svgo >=3.3.3 (DoS via entity expansion) - serialize-javascript >=7.0.3 (RCE via RegExp/Date) Changes: - Added resolutions for immutable, svgo, serialize-javascript in root package.json - Upgraded @svgr/webpack from ^5.5.0 to ^8.1.0 in amplify-graphiql-explorer * chore: run yarn dedupe to fix CI verify_yarn_lock check * fix: use ^ instead of >= in dependency resolutions for safety * feat: add retry on throttling exceptions for ssm * fix: update few code fixes * chore: e2e and dependabot management scripting + agent docs (#14625) * feat: add agentic workflow infrastructure - Add AGENTS.md with workflow guide for AI agents - Add .agent-docs/DEPENDABOT.md for dependency management workflow - Add .agent-docs/LOCAL_E2E_TESTING.md for local testing guide - Add scripts/e2e-test-manager.ts for e2e test management - Add scripts/check-dependabot.ts for checking security alerts - Add e2e management commands to package.json (e2e-status, e2e-retry, e2e-monitor, etc.) - Add AWS SDK dependencies to scripts/package.json This infrastructure enables AI coding tools to: - Monitor e2e test status with auto-retry - Check and manage Dependabot alerts - Follow consistent workflows for development and testing * docs: add README for .agent-docs directory * fix: remove interactive mwinit from cloud-cli-utils.sh - Remove automatic mwinit call that prompts for credentials - Let ada command fail naturally if credentials not available - Provide clear error message instructing user to run mwinit - Matches pattern from amplify-category-api repo * fix: use correct role name CodeBuildE2E in e2e-test-manager - Change from CodebuildDeveloper (category-api) to CodeBuildE2E (cli-gen1) - Matches role name used in cloud-cli-utils.sh * fix: format .agent-docs/README.md with prettier - Add blank lines between sections per prettier rules - Fixes lint failure in e2e tests * feat: add CODEBUILD_IMAGE_OVERRIDE support - Allow specifying custom container image via CODEBUILD_IMAGE_OVERRIDE env var - Matches pattern from amplify-category-api repo - Enables testing with updated container images Usage: CODEBUILD_IMAGE_OVERRIDE=<image-uri> yarn cloud-e2e * feat: bump version (#14665) * chore: fixes smoke tests (#14670) * chore: remove outdated node version from smoke test * fix: node 22 compatibility for process.exit and nexpect error logging * fix: detect windows test * fix: change node version to node 20 * fix: remove process.env * fix: crypto flag for node 18 * chore: mid work * chore: mid work * chore: mid work * fix(e2e): improve smoke test stability (#14672) * fix: change MaxResults from 50 to 10 (#14676) * Revert/amplify cdk bump (#14681) * Revert "chore: run yarn dedupe to fix CI verify_yarn_lock check" This reverts commit 95635e1. * Revert "fix: bump aws-cdk-lib to 2.241.0 and constructs to 10.5.0" This reverts commit b7ea5cf. * chore: update container Dockerfiles to Node 22 LTS and nginx stable (#14687) * chore(release): Publish latest - @aws-amplify/amplify-app@5.0.46 - @aws-amplify/amplify-appsync-simulator@2.16.18 - @aws-amplify/amplify-category-function@5.8.0 - @aws-amplify/cli-internal@14.3.0 - @aws-amplify/cli@14.3.0 - @aws-amplify/amplify-console-integration-tests@2.11.30 - @aws-amplify/amplify-container-hosting@2.8.25 - amplify-dynamodb-simulator@2.9.28 - @aws-amplify/amplify-e2e-core@5.7.11 - amplify-e2e-tests@4.11.16 - @aws-amplify/amplify-graphiql-explorer@2.6.5 - @aws-amplify/amplify-migration-tests@6.5.12 - @aws-amplify/amplify-opensearch-simulator@1.7.24 - @aws-amplify/amplify-util-mock@5.10.27 * chore(deps): bump flatted from 3.2.4 to 3.4.2 (#14694) Bumps [flatted](https://github.com/WebReflection/flatted) from 3.2.4 to 3.4.2. - [Commits](WebReflection/flatted@v3.2.4...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump brace-expansion from 1.1.12 to 1.1.13 in /scripts (#14734) Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.12 to 1.1.13. - [Release notes](https://github.com/juliangruber/brace-expansion/releases) - [Commits](juliangruber/brace-expansion@v1.1.12...v1.1.13) --- updated-dependencies: - dependency-name: brace-expansion dependency-version: 1.1.13 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * amplify-cli gen2 migration out of alpha * readme * prettier * review changes --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: aws-amplify-bot <aws@amazon.com> Co-authored-by: Otavio Macedo <288203+otaviomacedo@users.noreply.github.com> Co-authored-by: Eli Polonsky <Eli.polonsky@gmail.com> Co-authored-by: Sai Ray <saisujit.sb@gmail.com> Co-authored-by: Sai Ray <saisujit@amazon.com> Co-authored-by: Leena <81589006+ShadowCat567@users.noreply.github.com> Co-authored-by: Jon Wire <iambipedal@gmail.com> Co-authored-by: Galib Sarayev <sarayev@amazon.com> Co-authored-by: sarayev <126112721+sarayev@users.noreply.github.com> Co-authored-by: sanjanaravikumar-az <sanjana.ravikumar.az@gmail.com>
1 parent 933ee94 commit 8ec55c5

73 files changed

Lines changed: 4087 additions & 1216 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agent-docs/DEPENDABOT.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Dependabot Upgrade Workflow
2+
3+
Guide for handling Dependabot alerts, dependency upgrades, and security fixes.
4+
5+
## Checking Dependabot Alerts
6+
7+
**Prerequisites:** GitHub CLI (`gh`) must be installed and authenticated.
8+
9+
Install:
10+
11+
```bash
12+
# macOS
13+
brew install gh
14+
15+
# Windows
16+
winget install GitHub.cli
17+
18+
# Linux
19+
# See https://github.com/cli/cli#installation
20+
```
21+
22+
Authenticate:
23+
24+
```bash
25+
gh auth login
26+
```
27+
28+
Check alerts:
29+
30+
```bash
31+
npx ts-node scripts/check-dependabot.ts
32+
```
33+
34+
## Workflow for Agents
35+
36+
When asked to handle dependency upgrades, security fixes, or Dependabot issues:
37+
38+
### 1. Check Outstanding Alerts
39+
40+
Run the Dependabot checker to get current alerts.
41+
42+
### 2. Summarize and Categorize
43+
44+
Group alerts into categories:
45+
46+
- **Dependency updates only** - Simple version bumps in package.json
47+
- **Code changes required** - Breaking changes needing code modifications
48+
- **Security fixes** - CVE patches (prioritize by severity: critical > high > medium > low)
49+
50+
Present summary to user with counts per category.
51+
52+
### 3. Ask User for Scope
53+
54+
Confirm what to address:
55+
56+
- All alerts in a single PR?
57+
- Only dependency updates?
58+
- Only security fixes above a certain severity?
59+
- Specific packages?
60+
61+
### 4. Make Changes
62+
63+
For each change:
64+
65+
- Update package.json (or relevant package files)
66+
- Run `yarn install` to update yarn.lock
67+
- Run `yarn build` to verify build succeeds
68+
- Run `yarn test` to verify tests pass
69+
- Fix any breaking changes if needed
70+
71+
### 5. Commit and Push
72+
73+
```bash
74+
git checkout -b dependabot-fixes-YYYY-MM-DD
75+
git add .
76+
git commit -m "fix: address dependabot alerts
77+
78+
- Update package1 to vX.Y.Z
79+
- Update package2 to vX.Y.Z
80+
- Fix breaking changes in ..."
81+
git push origin dependabot-fixes-YYYY-MM-DD
82+
```
83+
84+
### 6. E2E Test
85+
86+
Follow the e2e workflow from AGENTS.md:
87+
88+
```bash
89+
yarn cloud-e2e
90+
yarn e2e-monitor {batchId}
91+
```
92+
93+
### 7. Resolve Errors
94+
95+
- If e2e tests fail due to code issues, fix and repeat from step 4
96+
- If timeouts/quota errors, retry the build
97+
- Ask user for guidance if errors persist after multiple attempts
98+
99+
## Notes
100+
101+
- Always run local tests before pushing
102+
- Group related updates together when possible
103+
- Document breaking changes in commit messages
104+
- Check for peer dependency conflicts after updates

.agent-docs/LOCAL_E2E_TESTING.md

Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
# Local E2E Testing and Build Simulation
2+
3+
This guide explains how to run e2e test steps and build jobs locally to debug failures before pushing to CI.
4+
5+
## Overview
6+
7+
E2E tests run in AWS CodeBuild with specific build steps defined in `codebuild_specs/*.yml`. Each build spec calls functions from `shared-scripts.sh`. You can simulate these steps locally to debug issues.
8+
9+
## Prerequisites
10+
11+
### Authentication
12+
13+
Most e2e operations require AWS credentials. The repository uses `ada` (Amazon's credential management tool) for authentication, which is called automatically by the scripts.
14+
15+
**Setup:**
16+
17+
1. Ensure you have `ada` and `mwinit` installed
18+
2. Create `scripts/.env` file with account details:
19+
```bash
20+
# scripts/.env
21+
E2E_ACCOUNT_PROD=<account-id>
22+
E2E_ACCOUNT_BETA=<account-id>
23+
```
24+
3. If you see authentication errors, run `mwinit` in your terminal
25+
26+
**Note:** The scripts automatically call `ada` for credential refresh. You don't need to run `ada` commands manually.
27+
28+
## Common Build Steps
29+
30+
### 1. Unit Tests (`test` build)
31+
32+
**What it does:** Runs all unit tests with coverage in CI mode
33+
34+
**Command:**
35+
36+
```bash
37+
yarn test-ci
38+
```
39+
40+
**Equivalent to:**
41+
42+
```bash
43+
lerna run test --concurrency 4 -- --ci -i
44+
```
45+
46+
**Common issues:**
47+
48+
- Coverage threshold failures: Check `jest.config.js` in the failing package
49+
- Pre-existing coverage issues may not be related to your changes
50+
- To verify if an issue is pre-existing, test on the base branch
51+
52+
### 2. Linting (`lint` build)
53+
54+
**What it does:** Checks code style and linting rules
55+
56+
**Command:**
57+
58+
```bash
59+
yarn lint-check
60+
```
61+
62+
**Common issues:**
63+
64+
- Use `yarn lint-fix` to auto-fix some issues
65+
- Some lint errors require manual fixes
66+
- Check `.eslintrc.js` for linting rules
67+
68+
### 3. Local Registry Publish (`publish_to_local_registry` build)
69+
70+
**What it does:** Publishes packages to a local Verdaccio registry for e2e testing
71+
72+
**Command:**
73+
74+
```bash
75+
# Start Verdaccio (in separate terminal)
76+
yarn verdaccio-start
77+
78+
# Publish packages
79+
yarn publish-to-verdaccio
80+
81+
# Stop Verdaccio when done
82+
yarn verdaccio-stop
83+
```
84+
85+
**Common issues:**
86+
87+
- Requires Verdaccio running locally
88+
- May fail if packages have version conflicts
89+
- Check `lerna.json` for version configuration
90+
91+
### 4. Windows Build (`build_windows` build)
92+
93+
**What it does:** Builds all packages on Windows with Node.js 22 or later
94+
95+
**Command (on Windows):**
96+
97+
```powershell
98+
yarn production-build
99+
yarn build-tests
100+
```
101+
102+
**Command (on macOS/Linux):**
103+
Cannot be fully simulated on non-Windows systems. However, you can:
104+
105+
```bash
106+
yarn production-build
107+
yarn build-tests
108+
```
109+
110+
**Common issues:**
111+
112+
- Path separator differences (Windows uses `\`, Unix uses `/`)
113+
- Line ending differences (CRLF vs LF)
114+
- Case-sensitive filesystem differences
115+
- Windows-specific Node.js modules
116+
117+
### 5. Linux Build (`build_linux` build)
118+
119+
**What it does:** Builds all packages on Linux
120+
121+
**Command:**
122+
123+
```bash
124+
yarn production-build
125+
yarn build-tests
126+
```
127+
128+
**Common issues:**
129+
130+
- Build errors usually indicate TypeScript or dependency issues
131+
- Check for missing dependencies in package.json files
132+
133+
## Debugging E2E Failures
134+
135+
### Step 1: Identify the Failing Build
136+
137+
```bash
138+
yarn e2e-failed <batch-id>
139+
```
140+
141+
This shows which specific builds failed.
142+
143+
### Step 2: Get Build Logs
144+
145+
```bash
146+
yarn e2e-logs <build-id>
147+
```
148+
149+
This downloads and displays the full build log.
150+
151+
### Step 3: Simulate Locally
152+
153+
Run the equivalent local command (see sections above) to reproduce the issue.
154+
155+
### Step 4: Check for Pre-existing Issues
156+
157+
Before fixing, verify the issue exists on the base branch:
158+
159+
```bash
160+
# Stash your changes
161+
git stash
162+
163+
# Checkout base branch
164+
git checkout dev
165+
166+
# Run the failing command
167+
yarn <command>
168+
169+
# Restore your changes
170+
git checkout <your-branch>
171+
git stash pop
172+
```
173+
174+
## E2E Test Workflow
175+
176+
### Full E2E Test Suite
177+
178+
```bash
179+
# 1. Commit and push all changes
180+
git push
181+
182+
# 2. Trigger e2e suite
183+
yarn cloud-e2e
184+
185+
# 3. Monitor with auto-retry
186+
yarn e2e-monitor <batch-id>
187+
```
188+
189+
### Targeted E2E Tests
190+
191+
You can run specific e2e test files locally:
192+
193+
```bash
194+
# Run specific test file
195+
cd packages/amplify-e2e-tests
196+
yarn e2e src/__tests__/api_1.test.ts
197+
```
198+
199+
**Note:** Local e2e tests still require AWS credentials and will create real resources in your AWS account.
200+
201+
## Common Failure Patterns
202+
203+
### 1. Transient Infrastructure Failures
204+
205+
**Symptoms:**
206+
207+
- Timeout errors
208+
- Credential expiration
209+
- Quota/limit errors
210+
211+
**Solution:** Retry the build
212+
213+
```bash
214+
yarn e2e-retry <batch-id>
215+
```
216+
217+
### 2. Code-Related Failures
218+
219+
**Symptoms:**
220+
221+
- Test failures
222+
- Build errors
223+
- Linting errors
224+
- Coverage threshold failures
225+
226+
**Solution:** Fix the code and re-run locally, then push and re-trigger e2e tests
227+
228+
### 3. Dependency-Related Failures
229+
230+
**Symptoms:**
231+
232+
- Module not found errors
233+
- Version conflicts
234+
- Breaking API changes
235+
236+
**Solution:**
237+
238+
- Check if dependency upgrade is necessary
239+
- Look for major version changes that may have breaking changes
240+
- Consider pinning to a compatible version
241+
242+
## Build Job Types
243+
244+
The e2e workflow includes these build types:
245+
246+
- `build_linux` - Build on Linux (not retried by monitor)
247+
- `build_windows` - Build on Windows (not retried by monitor)
248+
- `test` - Run unit tests (not retried by monitor)
249+
- `lint` - Run linting (not retried by monitor)
250+
- `verify_yarn_lock` - Verify yarn.lock consistency
251+
- `publish_to_local_registry` - Publish to Verdaccio
252+
- `amplify_e2e_tests_*` - E2E test suites (multiple jobs)
253+
254+
**Note:** The monitor script skips auto-retrying `build_linux`, `build_windows`, `test`, and `lint` because failures in these are typically code-related and require fixes, not retries.
255+
256+
## Tips
257+
258+
1. **Always test locally first** before pushing to CI
259+
2. **Check pre-commit hooks** - they run tests automatically
260+
3. **Monitor resource usage** - e2e tests create real AWS resources
261+
4. **Clean up resources** - use cleanup scripts periodically
262+
5. **Check credentials** - most failures are due to expired credentials
263+
6. **Read the logs** - build logs contain detailed error information
264+
265+
## Troubleshooting
266+
267+
### "Command failed with exit code 1"
268+
269+
This is a generic error. Check the full output for the actual error message.
270+
271+
### "Cannot read properties of undefined"
272+
273+
Often indicates a dependency version mismatch or breaking API change.
274+
275+
### "Coverage threshold not met"
276+
277+
Check if this is a pre-existing issue by testing on the base branch. Coverage can change due to:
278+
279+
- Code changes
280+
- Dependency updates affecting how coverage is calculated
281+
- Test changes
282+
283+
### "Linting errors"
284+
285+
Run `yarn lint-fix` to auto-fix some issues. Others require manual fixes.
286+
287+
## Related Documentation
288+
289+
- [DEPENDABOT.md](./DEPENDABOT.md) - Dependency update workflow
290+
- [AGENTS.md](../AGENTS.md) - General agent workflow
291+
- [shared-scripts.sh](../shared-scripts.sh) - Build step implementations

0 commit comments

Comments
 (0)