Make auto-upgrade enabled by default, remove activation prompt#7519
Make auto-upgrade enabled by default, remove activation prompt#7519alfonso-noriega wants to merge 1 commit into
Conversation
|
/snapit |
|
| Changeset | Package |
|---|---|
thin-webs-notice.md |
'@shopify/plugin-did-you-mean': major |
thin-webs-notice.md |
'@shopify/plugin-cloudflare': major |
thin-webs-notice.md |
'@shopify/create-app': major |
thin-webs-notice.md |
'@shopify/cli-kit': major |
thin-webs-notice.md |
'@shopify/store': major |
thin-webs-notice.md |
'@shopify/theme': major |
thin-webs-notice.md |
'@shopify/app': major |
thin-webs-notice.md |
'@shopify/cli': major |
thin-webs-notice.md |
'@shopify/e2e': major |
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/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;
/**
* Checks the freshly fetched notifications feed for a kill-switch notification that
* disables auto-upgrade. A blocking notification is one with `surface: "autoupgrade"`,
* `type: "error"`, and matching version/date ranges for the current CLI.
*
* Fails open: any error fetching or parsing the feed results in `false`, so a broken
* notifications endpoint never prevents users from auto-upgrading. Intentionally silent
* (no logs) — this is invoked on the auto-upgrade hot path.
*
* @returns `true` when an active blocking notification is found, `false` otherwise.
*/
export declare function hasBlockingAutoUpgradeNotification(): Promise<boolean>;
/**
* 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>;
|
|
🫰✨ Thanks @alfonso-noriega! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260511112626Caution After installing, validate the version by running |
Auto-upgrade enabled by default
Auto-upgrade is now on by default, removing the requirement for users to explicitly opt in before upgrades take effect.
Previously,
getAutoUpgradeEnabledreturnedundefinedwhen the preference had never been set, and theshopify upgradecommand would prompt users to opt in before proceeding. This meant auto-upgrade was effectively disabled until a user consciously enabled it.Now:
getAutoUpgradeEnabledreturnstruewhen no preference has been stored, making auto-upgrade active out of the box.promptAutoUpgradefunction and its associated opt-in flow have been removed from theshopify upgradecommand — it now callsrunCLIUpgradedirectly.notConfiguredstatus message has been removed; users who have never explicitly set a preference will see the "Auto-upgrade on" message instead.env_auto_upgrade_acceptedmetadata tracking tied to the prompt has been removed.Users can still disable auto-upgrade explicitly via
setAutoUpgradeEnabled(false)or check the current state withshopify config autoupgrade status.