Skip to content

Surface preview store auth scopes in store info --json#7949

Merged
amcaplan merged 1 commit into
mainfrom
store-info-auth-scopes
Jun 29, 2026
Merged

Surface preview store auth scopes in store info --json#7949
amcaplan merged 1 commit into
mainfrom
store-info-auth-scopes

Conversation

@amcaplan

@amcaplan amcaplan commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Preview stores cache the Admin API scopes granted at creation time (see #7948). Since preview stores aren't a logged-in experience, those scopes are fixed and there's no way to grant more later. Consumers — especially agents driving the CLI — need a reliable way to discover which scopes are preapproved without attempting an auth flow that can't work.

Second PR in the stack:

  1. Cache Admin API scopes returned by preview store creation #7948 — Cache the Admin API scopes returned by preview store creation.
  2. Surface preview store auth scopes in store info --json #7949 (this PR) — Surface those scopes in store info --json.
  3. Exit store auth early for preview stores #7950 — Exit store auth early for preview stores, listing the preapproved scopes.

WHAT is this pull request doing?

  • types.ts: add an optional authScopes?: string[] field to StoreInfoResult, documenting that it carries the preapproved Admin API scopes (currently only for preview stores).
  • info/index.ts: buildPreviewStoreResult now always emits authScopes from the cached preview session scopes — even when empty — so --json consumers can reliably rely on the key being present.

No changeset — preview stores aren't released yet.

How to test your changes?

  1. Create a preview store from the CLI (so its scopes are cached).
  2. Run shopify store info --store <preview-store> --json.
  3. Confirm the output includes an authScopes array with the preapproved scopes.

Unit tests cover: surfacing cached scopes for a locally stored preview store, emitting the key when empty, and including authScopes in the JSON output.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type and added a changeset. (N/A — preview stores aren't released yet.)

amcaplan commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Jun 28, 2026
@amcaplan amcaplan force-pushed the preview-store-cache-scopes branch from 7554acb to 7e206fe Compare June 28, 2026 17:09
@amcaplan amcaplan force-pushed the store-info-auth-scopes branch from 307d191 to c608d3d Compare June 28, 2026 17:09
Add an authScopes key to the store info result and populate it from the
cached preview-store session scopes. Preview stores aren't a logged-in
experience, so the scopes granted at creation time are the only ones
available; surfacing them helps humans and agents understand what Admin
API operations they can run.

The key is always present for preview stores (even when empty).

Assisted-By: devx/f38d0794-3b14-4a2a-a849-b95ae665f83d
@amcaplan amcaplan force-pushed the store-info-auth-scopes branch from c608d3d to 518dabd Compare June 28, 2026 17:14
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Jun 28, 2026
@amcaplan amcaplan marked this pull request as ready for review June 29, 2026 16:07
@amcaplan amcaplan requested a review from a team as a code owner June 29, 2026 16:07
Base automatically changed from preview-store-cache-scopes to main June 29, 2026 16:29
@amcaplan amcaplan added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit 7c3e5d3 Jun 29, 2026
26 checks passed
@amcaplan amcaplan deleted the store-info-auth-scopes branch June 29, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants