Skip to content

Add install count warning for safer deploys#7087

Open
alfonso-noriega wants to merge 1 commit intomainfrom
03-24-add_install_count_warning_for_safer_deploys
Open

Add install count warning for safer deploys#7087
alfonso-noriega wants to merge 1 commit intomainfrom
03-24-add_install_count_warning_for_safer_deploys

Conversation

@alfonso-noriega
Copy link
Contributor

@alfonso-noriega alfonso-noriega commented Mar 24, 2026

🚨 NOTE: Do not merge before PR#532386 is deployed 🚨

What

Surfaces the number of affected app installations in the app deploy / app release confirmation prompt when a release removes extensions. This gives developers a clear picture of the blast radius before they confirm a destructive operation.

?  Release a new version of adaptive-vertical-app-prod?

   Extensions:
   - yo (uid: 5aab8bdc-...) (removed)

   WARNING
   This release removes extensions and related data from 1 243 app installations.
   Use caution as this may include production data on live stores.

   Type adaptive-vertical-app-prod to confirm, or press Escape to cancel.
>  █

Closes https://github.com/shop/issues-develop/issues/22421

How

New GraphQL query (app-install-count.graphql) — queries installCount on the App type, exposed by the Management API in shop/world#532386.

New appInstallCount() method on DeveloperPlatformClient + AppManagementClient implementation. PartnersClient stubs it as unsupported.

Fetched lazily in ensureDeploymentIdsPresence() — only when the extension breakdown contains removals (onlyRemote.length > 0), right before the confirmation prompt. Wrapped in try/catch so a failure never blocks the deploy.

Warning rendered in deploy-release.ts — added to the dangerous confirmation prompt (the one requiring the user to type the app name) when hasDeletedExtensions && installCount > 0.

Behaviour unchanged in these paths

  • Non-interactive (--no-interactive / piped input) — prompt is skipped entirely
  • --force / --allow-deletes — prompt is skipped entirely
  • API call failure — warning is silently omitted, deploy proceeds normally

Copy link
Contributor Author

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

@alfonso-noriega alfonso-noriega force-pushed the 03-24-add_install_count_warning_for_safer_deploys branch from 8257ac9 to 40cf609 Compare March 24, 2026 10:49
@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.13% 14935/18184
🟡 Branches 74.51% 7378/9902
🟢 Functions 81.25% 3779/4651
🟢 Lines 82.51% 14119/17111

Test suite run success

3933 tests passing in 1514 suites.

Report generated by 🧪jest coverage report action from 0a8f305

@alfonso-noriega alfonso-noriega force-pushed the 03-24-add_install_count_warning_for_safer_deploys branch from 40cf609 to 446e18a Compare March 24, 2026 16:12
@alfonso-noriega alfonso-noriega marked this pull request as ready for review March 24, 2026 17:04
@alfonso-noriega alfonso-noriega requested a review from a team as a code owner March 24, 2026 17:04
@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

Copy link
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

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

Found a few things worth considering

@alfonso-noriega alfonso-noriega force-pushed the 03-24-add_install_count_warning_for_safer_deploys branch from 446e18a to 0a8f305 Compare March 25, 2026 17:43
@alfonso-noriega alfonso-noriega requested a review from dmerand March 25, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants