Skip to content

Explain why store delete prompts for an organization - #8469

Merged
amcaplan merged 2 commits into
mainfrom
explain-store-delete-organization-prompting
Sep 3, 2026
Merged

Explain why store delete prompts for an organization#8469
amcaplan merged 2 commits into
mainfrom
explain-store-delete-organization-prompting

Conversation

@amcaplan

@amcaplan amcaplan commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Follow-up to a discussion with @nickwesselman on shopify store delete.

When you pass only --store, the command infers the owning organization from the Destinations API and, if that inference comes up empty, silently drops you into an organization picker. The picker says nothing about why it appeared, so a typo'd domain looks exactly like a store the CLI legitimately can't see.

The non-interactive path already explains itself (Could not determine which organization owns … + a --organization-id next step); the interactive path just prompts.

Requiring --organization-id unconditionally would remove the ambiguity but is burdensome day to day, and the picker is not dead weight — it's the only way through for several real cases:

  • You own the org but aren't a staff user on the store. Destination visibility needs an active shop_users row for you; delete permission only needs org ownership. A dev store a teammate created is invisible to your destinations search yet perfectly deletable — not exotic on a team org.
  • Inactive stores. The destinations search defaults to status: active, while the delete's own lookup has no status filter, so a paused or frozen dev store is unfindable but still addressable.
  • Transient failures. The inference swallows all errors and returns undefined, so any Business Platform hiccup lands you in the picker on a store that would have deleted fine.

You can't cheaply tell a typo from an org owner without shop access, so rather than guessing, say why you're being asked.

WHAT is this pull request doing?

Renders an info banner before the organization picker, naming the domain you typed:

╭─ info ───────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Could not determine which organization owns shop.myshopify.com.             │
│                                                                              │
│  Select one below, or specify it with `--organization-id`.                   │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

Echoing the domain back covers the typo case, and the --organization-id pointer covers the people who hit this repeatedly. packages/store/src/cli/utilities/store-lookup/organization.ts is the only place that needs to change — the banner sits with the prompt it explains, matching the pattern used for the empty-organization notice in app dev. Nothing changes for the --organization-id, successful-inference, or non-interactive paths.

The banner renders at info level, which goes to stderr, so --json output on stdout is unaffected.

How to test your changes?

  1. shopify store delete --store some-store-that-does-not-existzzz.myshopify.com
  2. The banner appears above the organization picker, naming the domain you passed.
  3. shopify store delete --store <a store you own> --force — no banner, inference still resolves the org directly.

Post-release steps

None.

Measuring impact

  • n/a - this doesn't need measurement, e.g. minor cleanup

When only a store domain is given, `store delete` infers the owning
organization from the Destinations API and silently drops into an
organization picker whenever that inference comes up empty. The picker
gives no hint about why it appeared, so a typo'd domain looks identical
to a store the CLI legitimately can't see.

Render an info banner ahead of the picker that names the domain the
developer typed and points at `--organization-id`. Echoing the domain
back surfaces typos, while the picker still serves the real cases —
org owners deleting a store a teammate created, inactive stores that
the destinations search filters out, and transient BP failures.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assisted-By: devx/24c9b352-4ee9-4e6b-93da-ffee608999b1
Copilot AI lite review requested due to automatic review settings September 3, 2026 18:06
@amcaplan
amcaplan requested a review from a team as a code owner September 3, 2026 18:06
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Sep 3, 2026

Copilot AI 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.

🟢 Approval recommended

The change is narrowly scoped to the interactive prompt fallback, includes focused test coverage, and doesn’t alter non-interactive behavior.

Pull request overview

Adds an explanatory info banner to the interactive fallback path of shopify store delete when the CLI can’t infer the owning organization from the provided store domain, so users understand why they’re being prompted to pick an organization (and can more easily spot typos).

Changes:

  • Render an info banner (stderr) immediately before the organization picker when org inference fails in interactive mode.
  • Add tests to verify the banner appears only on the prompt fallback path and stays silent when inference succeeds.
  • Add a changeset to publish the user-facing output change in @shopify/store.
File summaries
File Description
packages/store/src/cli/utilities/store-lookup/organization.ts Renders an info banner explaining the org picker when inference fails interactively.
packages/store/src/cli/utilities/store-lookup/organization.test.ts Adds output-capture assertions for the new banner and confirms quiet behavior when inference succeeds.
.changeset/store-delete-organization-prompt-notice.md Publishes the new user-facing notice in release notes.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

It's going to go out along with the command being shipped, no need for a separate changeset
@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 Sep 3, 2026
@amcaplan
amcaplan enabled auto-merge September 3, 2026 18:23
@amcaplan
amcaplan added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit f333e49 Sep 3, 2026
30 checks passed
@amcaplan
amcaplan deleted the explain-store-delete-organization-prompting branch September 3, 2026 18:38
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.

4 participants