Skip to content

fix(cli-internal): bump amplify-category-api gen1 deps to 5.15.8 - #15012

Open
svidgen wants to merge 11 commits into
devfrom
wirej/bump-category-api-5.15.8
Open

svidgen wants to merge 11 commits into
devfrom
wirej/bump-category-api-5.15.8

Conversation

@svidgen

@svidgen svidgen commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Description

Bumps the bundled Gen1 API category to @aws-amplify/amplify-category-api 5.15.8 (graphql-auth-transformer 3.6.18). This brings in the changes from amplify-category-api 5.15.7 and 5.15.8.

Behavior changes to note in the release

These take effect for an API when its resolvers are regenerated by amplify push with this CLI.

From 5.15.7:

  • adminRoleNames in custom-roles.json must match the IAM role name exactly. Before, an entry also matched any caller whose ARN contained it (for example a prefix like amplify-<app-id>, an account ID or an IAM user).
  • Functions with access to the API get admin access by their Lambda execution role name. If the CLI cannot determine that name, it prints a warning and the function gets no admin access.
  • A full STS assumed-role ARN in adminRoleNames is reduced to the role name. IAM role ARNs are ignored with a warning, since they never match the caller identity.

From 5.15.8 (amplify-category-api #3558):

  • Field resolvers apply field-level @auth rules for list, search, listen and sync operations.

Push-time reminder

When a GraphQL API in the push has adminRoleNames entries in custom-roles.json, amplify push lists them and reminds that each must be an exact IAM role name. It appears before the "Are you sure you want to continue?" prompt, also prints with --yes, makes no AWS calls and never fails the push. It only covers APIs in the push scope, and a malformed file skips only that API.

Test updates

  • api_10 snapshot updated for the regenerated resolvers.
  • amplify-e2e-gen2-migration harness (src/core/app.ts): the restored amplify-meta.json drops each function's recorded LambdaExecutionRole output, so admin roles resolve to the live environment's role names.
  • product-catalog migration app: its custom-roles.json used the prefix amplify-${appId}, which only worked through the substring match. The Gen2 authenticated role is now named amplify-<app>-<branch>-gen2-auth (unscoped package name; branch from AWS_BRANCH at synth time, else the sandbox identifier), and custom-roles.json lists that exact name for gen2-${env}. The README no longer asks for an app-id prefix.

Testing

  • Unit tests for the reminder, including the push scope and a malformed file; full amplify-cli unit suite passes (915 tests).
  • The role-name logic was checked to give the same name in pre-push.ts and in the generated backend.ts statement for a Hosting branch, the e2e harness and a sandbox.
  • e2e Linux and Windows and PR testing (cloud-pr) to be rerun on the new head.

@svidgen
svidgen requested a review from a team as a code owner November 24, 2026 17:33
@svidgen

svidgen commented Nov 24, 2026 •

Copy link
Copy Markdown
Member Author

Validation runs (CodeBuild), @ fc38ba531c:

Check Result Console
Cloud E2E (Linux) ⏳ running https://tiny.amazon.com/12v8wr2ah/isenamazfede
Cloud E2E (Windows) ✅ 134/134 https://tiny.amazon.com/p72y5ij6/isenamazfede
PR-Testing (required status) ✅ 17/17 https://tiny.amazon.com/pydhbm9s/isenamazfede

(IsenLinks → Readonly, account 671107461633.)

svidgen and others added 9 commits November 24, 2026 14:55
Admin roles in custom-roles.json now match on the exact role name. The product-catalog fixture listed a name prefix, which only matched the Gen2 authenticated role through the old substring match. Pin the Gen2 authenticated role name in post-generate and list that exact name in pre-push.
amplify push now prints an advisory warning when an adminRoleNames entry in
custom-roles.json does not match an IAM role name exactly: partial names
(with the roles that contain them), account IDs and IAM user names. The
GraphQL auth resolvers only match exact role names, so these entries grant
no admin access. Lookup failures skip the entry and never fail the push.
Replace the IAM-based adminRoleNames check with a static reminder. When a
pushed API has adminRoleNames entries, amplify push lists them and notes that
each must be an exact IAM role name. No IAM calls, so there are no permission
gaps or cross-account false warnings.
Move the adminRoleNames reminder from the provider deploy step into the CLI
push flow, right before "Are you sure you want to continue?", so it can be
read before deciding to push. It covers the GraphQL APIs being created or
updated, or all of them for a forced push.
soberm
soberm previously approved these changes Dec 2, 2026

@belaboe belaboe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bump and the api_10 snapshot match upstream #3528. A few things before merge:

  1. Title: we squash-merge and release notes only pick up fix/feat, so with chore: the behavior-change note won't appear. Suggest fix(cli-internal): ....
  2. Behavior change section: it covers custom-roles.json only. 5.15.7 also matches functions by execution role name (no admin access if the name can't be resolved), reduces full STS ARNs to the role name and ignores IAM role ARNs. 5.15.8 (#3558) changes field resolvers for list/search/listen/sync rules. Worth listing all of them.
  3. Harness bullet: against dev, app.ts drops each function's LambdaExecutionRole output; "keeps API outputs" describes the delta from 90447e7.
  4. product-catalog backend/custom-roles.json (amplify-${appId}) and README lines 211-216 still use the prefix, which now matches nothing. Only the e2e pre-push overwrites it.

- push: scope the custom-roles.json reminder to the APIs in the push
  (category, resource name, filtered resources), and skip only a malformed
  file instead of every API.
- product-catalog: name the Gen2 authenticated role
  amplify-<app>-<branch>-gen2-auth, using the unscoped package name and the
  branch read at synth time (AWS_BRANCH, else the sandbox identifier), so
  names contain no '/' and branches or sandboxes do not collide.
- product-catalog: backend/custom-roles.json lists that exact role name for
  gen2-${env}, and the README no longer asks for an app-id prefix.
@sarayev sarayev changed the title chore: bump amplify-category-api gen1 deps to 5.15.8 fix(cli-internal): bump amplify-category-api gen1 deps to 5.15.8 Dec 2, 2026
@sarayev

sarayev commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for the thorough review!

  1. Title is now fix(cli-internal): … so it shows up in the release notes.
  2. Description now lists all of them: exact adminRoleNames match, function admin access by execution role name (warns and skips if it can't be resolved), STS ARN reduced to the role name, IAM role ARNs ignored, and the getaddrinfo ENOTFOUND on amplify push #3558 field resolver change for list/search/listen/sync.
  3. Fixed the harness bullet. Against dev it drops each function's recorded LambdaExecutionRole from the restored meta.
  4. backend/custom-roles.json now has the exact Gen2 role name (amplify-product-catalog-gen2-${env}-gen2-auth), and I removed the app-id prefix step from the README.

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.

4 participants