Skip to content

fix(cli-internal): unblock e2e for release (gen2 migration, drift, e2e infra) - #14998

Merged
Simone319 merged 8 commits into
devfrom
fix/e2e-green-for-release
Oct 23, 2026
Merged

Simone319 merged 8 commits into
devfrom
fix/e2e-green-for-release

Conversation

@Simone319

@Simone319 Simone319 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description of changes

AmplifyCLI-E2E-Testing has not gone green since July, which blocks the release. This PR collects every change needed to get both split batches (Linux and Windows) green: two Gen2 migration codegen fixes and one drift-detection fix that were sitting on unmerged branches, plus three small e2e-infrastructure fixes for failures that were environmental. With this branch, both batches pass, with only known-flaky shards needing one RETRY_FAILED_BUILDS round.

The v1→v2 transformer migration tests that failed from July to September (<apiId>GraphQLSchema already exists in stack) were caused by a CloudFormation defect and have been fixed service-side; no change here (and #14963 is no longer needed).

Gen2 migration: generated auth UserPool Schema

All nine gen2_migration e2e apps failed the Gen2 sandbox deploy or the rollback push because the generated Gen2 auth construct re-emits login-derived attributes without an AttributeDataType, and Cognito rejects any Schema change on the imported Gen1 pool. The auth renderer now always emits cfnUserPool.addPropertyOverride('Schema', …): verbatim from the deployed Gen1 auth template when it is available, otherwise built from the live pool's attributes (declarable standard and custom attributes, each with its data type and Required: false). TS.jsValue now renders arrays of objects. Migration app snapshots are updated.

This contains the change from draft #14993 and extends it with the verbatim Gen1 Schema.

Gen2 migration: CDK toolkit pin in the generated app

@aws-cdk/toolkit-lib 1.32.0, which the floating backend-deployer range pulls in, forces Express mode when a sandbox hotswap falls back to a full deployment, breaking the refactor's replacement update. The generated root package.json now pins @aws-cdk/toolkit-lib to 1.40.0 through overrides. This replaces the broader dependency pins in draft #14990, which hit npm ERESOLVE.

Drift: leftover Gen2 DynamoDB stream tags

After gen2-migration refactor --rollback, tables keep the Gen2 stack tags that CloudFormation propagated onto their StreamSpecification, and the following gen2-migration lock failed on that drift. A new false-positive filter drops /StreamSpecification/Tags/N entries that are absent from the template and whose key is a known Amplify Gen2 tag; any other stream tag change is still reported.

E2E infrastructure

  • Tests that enable the Pinpoint SMS channel are pinned to us-west-2 via FORCE_REGION_MAP. On Windows they failed in most batches whenever their position-based region was ap-southeast-1 or eu-central-1 ("Failed to enable the SMS channel"), while the same tests never failed on Linux in us-west-2/us-east-2. Only CLI_REGION is added to the 12 affected shards in the generated specs.
  • The in-build retry now re-assumes the parent test account before each re-attempt. The parent session lasts one hour, so a first attempt longer than that made the retry fail before running any test (193 failed builds since 2026-08-10).
  • integration_test setup retries apt-get update and continues when only the third-party git-core PPA index fails (it returned 503 repeatedly).
  • The e2e HTML reporter no longer throws on circular references when serializing results.

Docs

drift.md lists the current false-positive filters (including the ApiKey /Expires filter from #14991, which was missing). gen2-migration/generate.md documents the Schema override and the toolkit-lib pin.

Notes for reviewers

  • The auth Schema now has two sources: the Gen1 template (used by every e2e app) and a live-pool fallback carried over from fix(cli): emit gen2 migration auth Schema override with Required:false #14993. The fallback's comments say Cognito rejects Required: true on the refactor update, while the verbatim path emits Required: true from the template and passes e2e. Worth deciding whether the fallback should stay.
  • The fitness-tracker app test lists workout programs including a newly created one can miss a just-created item (unpaginated, eventually consistent list on an owner-auth model); it failed once in three runs. A follow-up could page through nextToken and retry briefly.
  • Known flaky shards that may still need a retry: l_api_9a_api_6c and l_searchable_migration (AppSync returns "API not found" when creating the OpenSearch data source; service-side), container tests (ECS deployment awaiter), and upb (split-mode S3 cache race).

Issue #, if available

Supersedes drafts #14993 and #14990 (the /Expires part of #14990 already landed as #14991).

Description of how you validated changes

  • Split e2e on this change set: run 1 (fixes for Gen2, drift, reporter and SMS region) and run 2 (plus the retry fix) were both green — Windows 134/134 on the first attempt, Linux 160/160 after one RETRY_FAILED_BUILDS round for flaky shards (integration_test PPA 503, l_api_9a_api_6c). The integration_test apt change was validated in a scoped batch where the first apt-get update hit the 503 and the retry passed. Final split e2e on this PR's head (7fbae99): green with no batch retries — Linux 160/160, Windows 134/134. One shard (l_gen2_migration_fitness_tracker) passed on its in-build second attempt; its first attempt ran ~1h53m, so this also exercised the retry credential refresh.
  • packages/amplify-cli unit tests for the auth generator, package.json generator and drift detection: 3 suites / 50 tests pass locally (inline snapshots regenerated); the full unit suite (test job) passed in both e2e runs above.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Simone319 and others added 8 commits October 21, 2026 14:35
Gen2 migration e2e apps failed the Gen2 sandbox deploy and the rollback
push for two reasons, both fixed here.

The generated Gen2 auth construct re-emitted login-derived standard
attributes without an AttributeDataType, and Cognito rejected the
UserPool update against the imported Gen1 pool ("Invalid
AttributeDataType input" / attribute modification errors). The generated
auth override now sets the UserPool Schema via addPropertyOverride:
verbatim from the deployed Gen1 auth template when available, otherwise
built from the live pool's attributes with their data types, constraints
and Required:false.

@aws-cdk/toolkit-lib 1.32.0 (pulled transitively by the floating
backend-deployer range) forces Express mode when a hotswap falls back to
a full deployment, which breaks the refactor's replacement update
("Replacement type updates not supported on stack with
disable-rollback"). The generated Gen2 package.json now pins
@aws-cdk/toolkit-lib to 1.40.0 via overrides.

Migration app snapshots are updated. Adopted from the unmerged branches
combined/gen2-migration-e2e and run-cb-e2e/zimzha/gen2-cognito-schema,
where all nine gen2-migration e2e apps passed.
---
Prompt: I am going to release amplify CLI. The process to release
amplify-cli is documented in:
https://quip-amazon.com/C223Aqn7XrI6/Deprecated-Runbook-Amplify-CLI-Release-Process.
However, we couldn't get AmplifyCLI-E2E-Testing codebuild task to pass,
which is blocking the release. I want you to first understand how to run
the AmplifyCLI-E2E-Testing Codebuild job. Meanwhile you can spin up more
agents to analyze the historial codebuild job, and understand what are
the failures. Some of the job maybe created to test a fix to certain
failure, using a fix branch. After the analysis, I'd like you to adopt
all the necessary not-merged historical fix that would fix the
constantly failing or flaky tests. Then evaluate if any additional fix
is needed. Ultimately, I'd like all the tests to be able to pass after
some retry. Meanwhile, I'd like a report on all the failing tests, the
root cause of the failure, whether it is flaky, and what can we do to
fix it. In summary, I'd like you to iterate towards a passing e2e run on
codebuild.

Co-authored-by: Galib Sarayev <sarayev@amazon.com>
After gen2-migration refactor --rollback, DynamoDB tables keep the Gen2
stack tags that CloudFormation propagated onto their StreamSpecification
while they lived in the Gen2 stack. The Gen1 template does not declare
stream tags, so drift detection reported each leftover tag and the
subsequent gen2-migration lock failed (seen on the discussions and
mood-board e2e apps).

Drift detection now filters StreamSpecification tag entries that are
absent from the template and whose key is a known Amplify Gen2 tag
(amplify:deployment-type, created-by, gen2-migration/post-refactor). Any
other stream tag drift is still reported. Adopted from the unmerged
branch run-cb-e2e/zimzha/gen2-cognito-schema.
---
Prompt: I am going to release amplify CLI. The process to release
amplify-cli is documented in:
https://quip-amazon.com/C223Aqn7XrI6/Deprecated-Runbook-Amplify-CLI-Release-Process.
However, we couldn't get AmplifyCLI-E2E-Testing codebuild task to pass,
which is blocking the release. I want you to first understand how to run
the AmplifyCLI-E2E-Testing Codebuild job. Meanwhile you can spin up more
agents to analyze the historial codebuild job, and understand what are
the failures. Some of the job maybe created to test a fix to certain
failure, using a fix branch. After the analysis, I'd like you to adopt
all the necessary not-merged historical fix that would fix the
constantly failing or flaky tests. Then evaluate if any additional fix
is needed. Ultimately, I'd like all the tests to be able to pass after
some retry. Meanwhile, I'd like a report on all the failing tests, the
root cause of the failure, whether it is flaky, and what can we do to
fix it. In summary, I'd like you to iterate towards a passing e2e run on
codebuild.
The e2e HTML reporter serialized the jest results with a plain
JSON.stringify, which throws on circular references (for example error
objects attached to failed tests) and loses the run report. Circular
references are now replaced with "[Circular]". Adopted from the unmerged
branch run-cb-e2e/zimzha/gen2-cognito-schema.
---
Prompt: I am going to release amplify CLI. The process to release
amplify-cli is documented in:
https://quip-amazon.com/C223Aqn7XrI6/Deprecated-Runbook-Amplify-CLI-Release-Process.
However, we couldn't get AmplifyCLI-E2E-Testing codebuild task to pass,
which is blocking the release. I want you to first understand how to run
the AmplifyCLI-E2E-Testing Codebuild job. Meanwhile you can spin up more
agents to analyze the historial codebuild job, and understand what are
the failures. Some of the job maybe created to test a fix to certain
failure, using a fix branch. After the analysis, I'd like you to adopt
all the necessary not-merged historical fix that would fix the
constantly failing or flaky tests. Then evaluate if any additional fix
is needed. Ultimately, I'd like all the tests to be able to pass after
some retry. Meanwhile, I'd like a report on all the failing tests, the
root cause of the failure, whether it is flaky, and what can we do to
fix it. In summary, I'd like you to iterate towards a passing e2e run on
codebuild.
Windows e2e shards that enable the Pinpoint SMS channel failed with
"Failed to enable the SMS channel" in most recent batches whenever their
position-based region was ap-southeast-1 (w_function_permissions_env_5
13/21, w_notifications_analytics_compatibility_sms_2 15/22) or
eu-central-1 (w_notifications_sms_update 8/22), while the same tests on
Linux in us-west-2 / us-east-2 never failed (0/26).

The test files that enable the SMS channel are now pinned to us-west-2
through FORCE_REGION_MAP and the e2e workflow specs are regenerated.
Only CLI_REGION is added to the 12 affected shards; shard composition
and identifiers are unchanged.
---
Prompt: I am going to release amplify CLI. The process to release
amplify-cli is documented in:
https://quip-amazon.com/C223Aqn7XrI6/Deprecated-Runbook-Amplify-CLI-Release-Process.
However, we couldn't get AmplifyCLI-E2E-Testing codebuild task to pass,
which is blocking the release. I want you to first understand how to run
the AmplifyCLI-E2E-Testing Codebuild job. Meanwhile you can spin up more
agents to analyze the historial codebuild job, and understand what are
the failures. Some of the job maybe created to test a fix to certain
failure, using a fix branch. After the analysis, I'd like you to adopt
all the necessary not-merged historical fix that would fix the
constantly failing or flaky tests. Then evaluate if any additional fix
is needed. Ultimately, I'd like all the tests to be able to pass after
some retry. Meanwhile, I'd like a report on all the failing tests, the
root cause of the failure, whether it is flaky, and what can we do to
fix it. In summary, I'd like you to iterate towards a passing e2e run on
codebuild.
Each e2e shard gets a second in-build attempt through retry, but the
parent test account session assumed at the start of the build lasts one
hour. When the first attempt ran longer, the retry called
STS/Organizations with the expired session, jq failed on the empty
account list and the build exited with status 3 before running any test.
Since 2026-08-10 this cut the retry short in 193 failed builds
(gen2-migration shards, l_api_9a_api_6c, searchable and others).

retry now re-assumes the parent test account role from the CodeBuild
role before every attempt after the first, when
_loadTestAccountCredentials is available (all current callers define
it). Verified with a local simulation of retry that the second attempt
picks up freshly loaded credentials.
---
Prompt: I am going to release amplify CLI. The process to release
amplify-cli is documented in:
https://quip-amazon.com/C223Aqn7XrI6/Deprecated-Runbook-Amplify-CLI-Release-Process.
However, we couldn't get AmplifyCLI-E2E-Testing codebuild task to pass,
which is blocking the release. I want you to first understand how to run
the AmplifyCLI-E2E-Testing Codebuild job. Meanwhile you can spin up more
agents to analyze the historial codebuild job, and understand what are
the failures. Some of the job maybe created to test a fix to certain
failure, using a fix branch. After the analysis, I'd like you to adopt
all the necessary not-merged historical fix that would fix the
constantly failing or flaky tests. Then evaluate if any additional fix
is needed. Ultimately, I'd like all the tests to be able to pass after
some retry. Meanwhile, I'd like a report on all the failing tests, the
root cause of the failure, whether it is flaky, and what can we do to
fix it. In summary, I'd like you to iterate towards a passing e2e run on
codebuild.
integration_test failed in two of three runs on 2026-10-21 because
apt-get update exited 100 when the git-core launchpad PPA configured in
the build image returned 503 for its package index. The packages the job
installs come from the Ubuntu archive, so that index is not needed.

The index refresh is now retried once and the job continues with the
indexes that were fetched; if a required index is really missing, the
following apt-get install still fails.
---
Prompt: I am going to release amplify CLI. The process to release
amplify-cli is documented in:
https://quip-amazon.com/C223Aqn7XrI6/Deprecated-Runbook-Amplify-CLI-Release-Process.
However, we couldn't get AmplifyCLI-E2E-Testing codebuild task to pass,
which is blocking the release. I want you to first understand how to run
the AmplifyCLI-E2E-Testing Codebuild job. Meanwhile you can spin up more
agents to analyze the historial codebuild job, and understand what are
the failures. Some of the job maybe created to test a fix to certain
failure, using a fix branch. After the analysis, I'd like you to adopt
all the necessary not-merged historical fix that would fix the
constantly failing or flaky tests. Then evaluate if any additional fix
is needed. Ultimately, I'd like all the tests to be able to pass after
some retry. Meanwhile, I'd like a report on all the failing tests, the
root cause of the failure, whether it is flaky, and what can we do to
fix it. In summary, I'd like you to iterate towards a passing e2e run on
codebuild.
The two Schema override tests asserted on fragments of the generated
auth resource with toContain / toMatch. They now snapshot the complete
generated file, per the coding guidelines, so regressions in the rest of
the output are caught too. The snapshots encode the same behavior the
previous assertions checked.
---
Prompt: I am going to release amplify CLI. The process to release
amplify-cli is documented in:
https://quip-amazon.com/C223Aqn7XrI6/Deprecated-Runbook-Amplify-CLI-Release-Process.
However, we couldn't get AmplifyCLI-E2E-Testing codebuild task to pass,
which is blocking the release. I want you to first understand how to run
the AmplifyCLI-E2E-Testing Codebuild job. Meanwhile you can spin up more
agents to analyze the historial codebuild job, and understand what are
the failures. Some of the job maybe created to test a fix to certain
failure, using a fix branch. After the analysis, I'd like you to adopt
all the necessary not-merged historical fix that would fix the
constantly failing or flaky tests. Then evaluate if any additional fix
is needed. Ultimately, I'd like all the tests to be able to pass after
some retry. Meanwhile, I'd like a report on all the failing tests, the
root cause of the failure, whether it is flaky, and what can we do to
fix it. In summary, I'd like you to iterate towards a passing e2e run on
codebuild.
drift.md now lists every false-positive filter in detect-stack-drift.ts,
including the AppSync ApiKey /Expires filter that was missing and the
new Gen2 DynamoDB stream tag filter. gen2-migration/generate.md
documents the always-emitted auth UserPool Schema override and the
@aws-cdk/toolkit-lib pin in the generated root package.json.
---
Prompt: I am going to release amplify CLI. The process to release
amplify-cli is documented in:
https://quip-amazon.com/C223Aqn7XrI6/Deprecated-Runbook-Amplify-CLI-Release-Process.
However, we couldn't get AmplifyCLI-E2E-Testing codebuild task to pass,
which is blocking the release. I want you to first understand how to run
the AmplifyCLI-E2E-Testing Codebuild job. Meanwhile you can spin up more
agents to analyze the historial codebuild job, and understand what are
the failures. Some of the job maybe created to test a fix to certain
failure, using a fix branch. After the analysis, I'd like you to adopt
all the necessary not-merged historical fix that would fix the
constantly failing or flaky tests. Then evaluate if any additional fix
is needed. Ultimately, I'd like all the tests to be able to pass after
some retry. Meanwhile, I'd like a report on all the failing tests, the
root cause of the failure, whether it is flaky, and what can we do to
fix it. In summary, I'd like you to iterate towards a passing e2e run on
codebuild.
@Simone319
Simone319 marked this pull request as ready for review October 23, 2026 09:16
@Simone319
Simone319 requested a review from a team as a code owner October 23, 2026 09:16
@Simone319

Copy link
Copy Markdown
Contributor Author

AmplifyCLI-PR-Testing succeeded in: AmplifyCLI-PR-Testing:b3359210-b616-4503-9a04-e24f4fdd6ad4
AmplifyCLI-E2E-Testing succeeded in:

  • AmplifyCLI-E2E-Testing:b7a1a771-3aef-4631-91e2-ebe5bef1aab1
  • AmplifyCLI-E2E-Testing:e0c07f60-3e29-426e-863c-d3778696721f

@Simone319
Simone319 enabled auto-merge (squash) October 23, 2026 10:11
@Simone319
Simone319 merged commit 333fb43 into dev Oct 23, 2026
5 checks passed
@Simone319
Simone319 deleted the fix/e2e-green-for-release branch October 23, 2026 10:21
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