Show extension target changes in deploy/release confirmation prompt#7528
Draft
jamieguerrero wants to merge 1 commit into
Draft
Show extension target changes in deploy/release confirmation prompt#7528jamieguerrero wants to merge 1 commit into
jamieguerrero wants to merge 1 commit into
Conversation
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.
Contributor
There was a problem hiding this comment.
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.', | ||
| }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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:Solution
The CLI now detects target changes by comparing local extension configuration against the remote active version's targets:
extension_points/targetingarrays from local config vs remoteAppModuleVersion.config(removing: purchase.checkout.block.render)Before
After (removing targets)
Testing
breakdown-extensions.test.tsdeploy-release.test.ts