Skip to content

fix(cli): filter time-relative ApiKey /Expires drift + pin gen2 app deps - #14990

Draft
sarayev wants to merge 2 commits into
devfrom
fix/gen2-migration-e2e-both-fixes
Draft

sarayev wants to merge 2 commits into
devfrom
fix/gen2-migration-e2e-both-fixes

Conversation

@sarayev

@sarayev sarayev commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Two independent fixes for gen1->gen2 migration e2e failures. Neither is a migration-logic regression; the amplify-cli code is unchanged since the last green run in July. Both failures are environment-driven and were surfaced by external changes.

Fix 1 - AppSync ApiKey /Expires drift false positive (7 gen2_migration groups)

The gen2-migration drift gate flagged AWS::AppSync::ApiKey /Expires as drift. An ApiKey's Expires is createTime+validity set at deploy; the gate re-derives the expected Expires at a later lock time, so the two values legitimately differ by the deploy->lock elapsed time (observed ~20 min; e.g. deployed 1.7912736E+9 vs expected 1791274802). This is a benign time-relative difference, not schema drift. Adds a FALSE_POSITIVE_FILTER (isAppSyncApiKeyExpiresTimeRelativeDrift) that drops /Expires drift on AWS::AppSync::ApiKey when both values parse as epoch-like timestamps (> ~2020); no tolerance/closeness comparison, and the epoch guard prevents masking non-timestamp mutations.

Fix 2 - generated Gen2 app dependency float -> Cognito Invalid AttributeDataType (2 groups)

store_locator and fitness_tracker (the only apps with Cognito Lambda triggers, which drive a UserPool UPDATE) failed ampx sandbox with 'Invalid AttributeDataType input' on the UserPool. The generated app pins unbounded ^ ranges with no committed lockfile, so installs float per run; a newer @aws-amplify/auth-construct (1.12.0, via backend-auth 1.10.0 / backend >=1.25.0, published 2026-09-10) and/or aws-cdk-lib (floated to 2.271) emit a UserPool schema attribute the UPDATE path rejects. Pins @aws-amplify/backend ~1.23.0 and aws-cdk/aws-cdk-lib ~2.254.0 (the last-known-good July minors) so migrated apps resolve reproducibly. Other packages keep caret intentionally.

Testing

Unit: detect-stack-drift.test.ts 12/12; package.json.generator.test.ts 4/4. e2e: gen2-migration Linux split batch triggered (AmplifyCLI-E2E-Testing:70b94c16-5257-4c8b-b8ca-f9d75156c7e3), validation in progress.

This branch has not been deployed

No deployments
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.

1 participant