Skip to content

Make auto-upgrade enabled by default, remove activation prompt#7341

Open
alfonso-noriega wants to merge 2 commits intomainfrom
autoupgrade-on-by-default
Open

Make auto-upgrade enabled by default, remove activation prompt#7341
alfonso-noriega wants to merge 2 commits intomainfrom
autoupgrade-on-by-default

Conversation

@alfonso-noriega
Copy link
Copy Markdown
Contributor

@alfonso-noriega alfonso-noriega commented Apr 17, 2026

WHY are these changes introduced?

Auto-upgrade was opt-in, requiring users to run shopify upgrade and answer a prompt before it would ever activate automatically. This made it effectively a no-op for most users who never ran that command. Auto-upgrade should be on by default so everyone benefits from staying up to date.

WHAT is this pull request doing?

  • getAutoUpgradeEnabled now defaults to true — returns true when the preference has never been explicitly set (previously returned undefined, which disabled auto-upgrade)
  • Removed promptAutoUpgrade — the interactive "Enable automatic updates?" prompt that was the only way to activate auto-upgrade; no longer needed
  • shopify upgrade runs directly without prompting the user first
  • shopify config autoupgrade status no longer has a "not configured" state — users see either "on" (the default) or "off"
  • notConfigured constant removed from autoUpgradeStatus
  • Users who previously ran shopify config autoupgrade off are unaffected — an explicit false stored in their config is respected

How to test your changes?

  1. Fresh install (no prior autoUpgradeEnabled in config): run any CLI command — it should auto-upgrade after completion without any setup
  2. shopify config autoupgrade status → should show "on" by default
  3. shopify config autoupgrade off → should show "off"; subsequent status should show "off"
  4. shopify config autoupgrade on → re-enables; status shows "on"
  5. shopify upgrade → should run the upgrade directly without any prompt

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, so I've added a changelog entry with pnpm changeset add

@alfonso-noriega alfonso-noriega requested a review from a team as a code owner April 17, 2026 11:18
Copy link
Copy Markdown
Contributor Author

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

- getAutoUpgradeEnabled now returns true when never explicitly set
- Removed promptAutoUpgrade and its UI prompt
- shopify upgrade runs directly without prompting
- Updated tests to reflect new default-on behavior

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alfonso-noriega alfonso-noriega force-pushed the autoupgrade-on-by-default branch from b88d9ac to 1dd6257 Compare April 17, 2026 11:43
…rom status command

- Re-export setAutoUpgradeEnabled from @shopify/cli-kit/node/upgrade so
  config autoupgrade on/off commands continue to work
- Remove the undefined/notConfigured branch from status.ts (dead code now
  that getAutoUpgradeEnabled always returns boolean)
- Drop notConfigured from constants
- Update status.test.ts to replace the 'never set' test with default-enabled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/private/node/conf-store.d.ts
@@ -128,10 +128,11 @@ interface RunWithRateLimitOptions {
 export declare function runWithRateLimit(options: RunWithRateLimitOptions, config?: LocalStorage<ConfSchema>): Promise<boolean>;
 /**
  * Get auto-upgrade preference.
+ * Defaults to true if the preference has never been explicitly set.
  *
- * @returns Whether auto-upgrade is enabled, or undefined if never set.
+ * @returns Whether auto-upgrade is enabled.
  */
-export declare function getAutoUpgradeEnabled(config?: LocalStorage<ConfSchema>): boolean | undefined;
+export declare function getAutoUpgradeEnabled(config?: LocalStorage<ConfSchema>): boolean;
 /**
  * Set auto-upgrade preference.
  *
packages/cli-kit/dist/public/node/upgrade.d.ts
 import { getAutoUpgradeEnabled, setAutoUpgradeEnabled } from '../../private/node/conf-store.js';
 export { getAutoUpgradeEnabled, setAutoUpgradeEnabled };
 /**
  * Utility function for generating an install command for the user to run
  * to install an updated version of Shopify CLI.
  *
  * @returns A string with the command to run, or undefined if the package manager cannot be determined.
  */
 export declare function cliInstallCommand(): string | undefined;
 /**
  * Runs the CLI upgrade using the appropriate package manager.
  * Determines the install command and executes it.
  *
  * @throws AbortError if the package manager or command cannot be determined.
  */
 export declare function runCLIUpgrade(): Promise<void>;
 /**
  * Returns the version to auto-upgrade to, or undefined if auto-upgrade should be skipped.
- * Auto-upgrade is disabled by default and must be enabled via `shopify upgrade`.
+ * Auto-upgrade is enabled by default and can be disabled via `setAutoUpgradeEnabled(false)`.
  * Also skips for CI, pre-release versions, or when no newer version is available.
  *
  * @returns The version string to upgrade to, or undefined if no upgrade should happen.
  */
 export declare function versionToAutoUpgrade(): string | undefined;
 /**
  * Shows a daily upgrade-available warning for users who have not enabled auto-upgrade.
  * Skipped in CI and for pre-release versions. When auto-upgrade is enabled this is a no-op
  * because the postrun hook will handle the upgrade directly.
  */
 export declare function warnIfUpgradeAvailable(): Promise<void>;
 /**
  * Generates a message to remind the user to update the CLI.
  * For major version bumps, appends a link to the GitHub release notes so users
  * can review breaking changes before deciding to upgrade.
  *
  * @param version - The version to update to.
  * @param isMajor - Whether the version bump is a major version change.
  * @returns The message to remind the user to update the CLI.
  */
 export declare function getOutputUpdateCLIReminder(version: string, isMajor?: boolean): string;
-/**
- * Prompts the user to enable or disable automatic upgrades, then persists their choice.
- *
- * @returns Whether the user chose to enable auto-upgrade.
- */
-export declare function promptAutoUpgrade(): Promise<boolean>;

Copy link
Copy Markdown
Contributor

@craigmichaelmartin craigmichaelmartin left a comment

Choose a reason for hiding this comment

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

Yes!!!!

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.

3 participants