Skip to content

Show extension target changes in deploy/release confirmation prompt#7528

Draft
jamieguerrero wants to merge 1 commit into
mainfrom
jamie/show-target-changes-in-deploy-prompt
Draft

Show extension target changes in deploy/release confirmation prompt#7528
jamieguerrero wants to merge 1 commit into
mainfrom
jamie/show-target-changes-in-deploy-prompt

Conversation

@jamieguerrero
Copy link
Copy Markdown
Contributor

@jamieguerrero jamieguerrero commented May 11, 2026

Problem

When deploying/releasing an app version, the CLI shows extensions as 'No changes' even when their targets have changed (e.g., removing purchase.checkout.block.render). Partners only discover this after the version creation request fails with a server-side validation error:

Extension 'xxx' is removing targets: purchase.checkout.block.render.
Merchants with this extension activated at these targets will have an invalid configuration.

Solution

The CLI now detects target changes by comparing local extension configuration against the remote active version's targets:

  1. Target detection: Compares extension_points/targeting arrays from local config vs remote AppModuleVersion.config
  2. Shows changes: Extensions with target changes appear as 'updated' with details like (removing: purchase.checkout.block.render)
  3. Dangerous confirmation: When targets are being removed, shows a dangerous confirmation prompt (similar to extension deletion) with the warning:

    Removing extension targets can break the experience for merchants who have this extension activated at those targets.

  4. Safe for additions: Adding new targets only shows an 'updated' status without the dangerous prompt

Before

Extensions:
  • checkout-ui

After (removing targets)

⚠ Removing extension targets can break the experience for merchants...

Extensions:
  • checkout-ui (removing: purchase.checkout.block.render) (updated)

Testing

  • Added tests for target change detection in breakdown-extensions.test.ts
  • Added tests for dangerous prompt rendering in deploy-release.test.ts
  • All existing tests pass (36 total across both files)

When an extension's targets are being added or removed compared to the active
remote version, the CLI now:

1. Detects target changes by comparing local extension configuration
   (extension_points/targeting) against the remote AppModuleVersion config
2. Shows extensions with target changes as 'updated' with details like
   '(removing: purchase.checkout.block.render)'
3. Triggers a dangerous confirmation prompt when targets are being removed,
   similar to when extensions are fully deleted
4. Shows a helper text warning: 'Removing extension targets can break the
   experience for merchants who have this extension activated at those targets.'

This gives partners visibility into target changes before the version is
created, rather than only seeing a server-side validation error after the fact.
Copilot AI review requested due to automatic review settings May 11, 2026 15:58
@jamieguerrero jamieguerrero requested a review from a team as a code owner May 11, 2026 15:58
Copy link
Copy Markdown
Contributor Author

jamieguerrero commented May 11, 2026

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

@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label May 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the deploy/release confirmation prompt to surface extension target changes (added/removed targets) so users can better understand potentially breaking updates before confirming a deploy/release.

Changes:

  • Extend extension breakdown info to include addedTargets / removedTargets.
  • Compute local-vs-remote target changes for existing extensions and classify those extensions under toUpdate.
  • Display target change details in the deploy/release confirmation prompt and mark removed-target scenarios as “dangerous”.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/app/src/cli/services/context/breakdown-extensions.ts Adds target-change fields to breakdown info; computes target diffs from local/remote configs and reclassifies affected extensions as updates.
packages/app/src/cli/services/context/breakdown-extensions.test.ts Adds a test ensuring extensions with removed targets appear in toUpdate with removed-target details.
packages/app/src/cli/prompts/deploy-release.ts Updates confirmation prompt logic to show target change details and use a dangerous prompt when targets are removed.
packages/app/src/cli/prompts/deploy-release.test.ts Adds prompt-level tests for removed/added targets behavior (dangerous vs non-dangerous).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

: extensionsInfoTable,
)
if (isDangerous && hasDeletedExtensions) {
infoTable.push({...extensionsInfoTable, helperText: 'Removing extensions can permanently delete app user data'})
Comment on lines +516 to +527
if (typeof ep === 'string') return ep
if (ep && typeof ep === 'object' && 'target' in ep) return (ep as {target: string}).target
return undefined
})
.filter((t): t is string => t !== undefined)
.sort()
}

// Handle targeting: array of objects with target (e.g., payments extensions)
const targeting = configRecord.targeting as {target: string}[] | undefined
if (targeting && Array.isArray(targeting)) {
return targeting.map((t) => t.target).filter(Boolean).sort()
Comment on lines +381 to +390
expect(renderDangerousConfirmationPromptSpyOn).toHaveBeenCalledWith(
expect.objectContaining({
message: 'Release a new version of app title?',
confirmation: appTitle,
infoTable: expect.arrayContaining([
expect.objectContaining({
header: 'Extensions:',
helperText:
'Removing extension targets can break the experience for merchants who have this extension activated at those targets. Consider removing the extension and creating a new one instead.',
}),
@jamieguerrero jamieguerrero marked this pull request as draft May 11, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants