Skip to content

Add store delete command#8035

Open
alfonso-noriega wants to merge 1 commit into
mainfrom
store-delete-dev
Open

Add store delete command#8035
alfonso-noriega wants to merge 1 commit into
mainfrom
store-delete-dev

Conversation

@alfonso-noriega

@alfonso-noriega alfonso-noriega commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Fixes https://github.com/shop/issues-develop/issues/22936

Shopify CLI needs a CLI-side shopify store delete command for app development stores. Business Platform now accepts app development store deletion requests by calling Core billingCloseShop(immediate: true), but Core cancellation completes asynchronously and BP no longer eagerly removes the BP Shop row. Because mutation success means “close request accepted”, the CLI must wait for the authoritative cancellation signal from Organizations API instead of treating row disappearance as success.

WHAT is this pull request doing?

  • Adds a hidden shopify store delete command in @shopify/store for deleting development stores.
  • Supports the command flag shape: global flags, --json, --store, and --organization-id.
  • Adds the deleteAppDevelopmentStore Business Platform mutation document and typed document.
  • Resolves the target store’s shopifyShopId using the existing Organizations API accessible shops lookup before polling.
  • After a successful delete mutation, polls organization.accessibleShop(id:) until planName is exactly cancelled.
  • Keeps delete mutation user error handling unchanged and does not poll when the mutation returns user errors.
  • Uses bounded polling consistent with development store creation polling, and reports deletion as requested but not confirmed if cancellation is still asynchronous at timeout.
  • Treats a null accessibleShop response as inconclusive rather than confirmed cancellation.
  • Registers the command in the store plugin and CLI oclif manifest.
  • Adds tests for successful cancellation confirmation, mutation user errors, timeout behavior, and null accessibleShop polling responses.

How to test your changes?

  • pnpm --filter @shopify/store vitest run src/cli/commands/store/delete.test.ts src/cli/services/store/delete/dev.test.ts src/cli/services/store/info/organization-shop.test.ts
  • pnpm --filter @shopify/store lint
  • pnpm --filter @shopify/store type-check

Post-release steps

None.

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 (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jul 8, 2026
@alfonso-noriega
alfonso-noriega marked this pull request as ready for review July 8, 2026 11:09
@alfonso-noriega
alfonso-noriega requested review from a team as code owners July 8, 2026 11:09
@alexCevi

alexCevi commented Jul 9, 2026

Copy link
Copy Markdown

This has been NEEDED!

Comment thread packages/store/src/cli/commands/store/delete.ts Outdated
Comment thread packages/store/src/cli/commands/store/delete.ts Outdated
@alfonso-noriega

Copy link
Copy Markdown
Contributor Author

/snapit

1 similar comment
@alfonso-noriega

Copy link
Copy Markdown
Contributor Author

/snapit

@alfonso-noriega
alfonso-noriega force-pushed the store-delete-dev branch 2 times, most recently from 437d91f to 11125b5 Compare July 16, 2026 13:35
@github-actions github-actions Bot added Area: @shopify/cli @shopify/cli package issues and removed no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. labels Jul 16, 2026
Comment thread .changeset/confirm-store-cancellation.md Outdated
Comment thread packages/store/src/cli/services/store/info/organization-shop.ts Outdated
Comment thread packages/store/src/cli/services/store/delete/dev.ts

@isaacroldan isaacroldan 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.


Review assisted by pair-review

Comment thread packages/store/src/cli/services/store/delete/dev.ts Outdated
@alfonso-noriega
alfonso-noriega force-pushed the store-delete-dev branch 2 times, most recently from 56031ae to 638480a Compare July 16, 2026 16:22
@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 Jul 16, 2026
@alfonso-noriega
alfonso-noriega force-pushed the store-delete-dev branch 2 times, most recently from 155cf63 to 690aecd Compare July 16, 2026 16:35
Assisted-By: devx/921acb10-d127-42c8-8a9a-0314a325d188
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.

3 participants