Skip to content

Commit 4cbc015

Browse files
Fix CI: re-export setAutoUpgradeEnabled, remove notConfigured state from 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>
1 parent 1dd6257 commit 4cbc015

4 files changed

Lines changed: 6 additions & 10 deletions

File tree

packages/cli-kit/src/public/node/upgrade.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import {outputContent, outputDebug, outputInfo, outputToken, outputWarn} from '.
1414
import {cwd, moduleDirectory, sniffForPath} from './path.js'
1515
import {exec, isCI} from './system.js'
1616
import {isPreReleaseVersion} from './version.js'
17-
import {getAutoUpgradeEnabled, runAtMinimumInterval} from '../../private/node/conf-store.js'
17+
import {getAutoUpgradeEnabled, setAutoUpgradeEnabled, runAtMinimumInterval} from '../../private/node/conf-store.js'
1818
import {CLI_KIT_VERSION} from '../common/version.js'
1919

20-
export {getAutoUpgradeEnabled}
20+
export {getAutoUpgradeEnabled, setAutoUpgradeEnabled}
2121

2222
/**
2323
* Utility function for generating an install command for the user to run
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const autoUpgradeStatus = {
22
on: 'Auto-upgrade on. Shopify CLI will update automatically after each command.',
33
off: "Auto-upgrade off. You'll need to run `shopify upgrade` to update manually.",
4-
notConfigured: 'Auto-upgrade not configured. Run `shopify config autoupgrade on` to enable it.',
54
} as const

packages/cli/src/cli/commands/config/autoupgrade/status.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ describe('AutoupgradeStatus', () => {
4949
`)
5050
})
5151

52-
test('displays not configured message when never set', async () => {
52+
test('displays auto-upgrade on message when never explicitly set (default enabled)', async () => {
5353
// Given
54-
vi.mocked(getAutoUpgradeEnabled).mockReturnValue(undefined)
54+
vi.mocked(getAutoUpgradeEnabled).mockReturnValue(true)
5555
const config = new Config({root: __dirname})
5656
const outputMock = mockAndCaptureOutput()
5757
outputMock.clear()
@@ -63,8 +63,7 @@ describe('AutoupgradeStatus', () => {
6363
expect(outputMock.info()).toMatchInlineSnapshot(`
6464
"╭─ info ───────────────────────────────────────────────────────────────────────╮
6565
│ │
66-
│ Auto-upgrade not configured. Run \`shopify config autoupgrade on\` to enable │
67-
│ it. │
66+
│ Auto-upgrade on. Shopify CLI will update automatically after each command. │
6867
│ │
6968
╰──────────────────────────────────────────────────────────────────────────────╯
7069
"

packages/cli/src/cli/commands/config/autoupgrade/status.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export default class AutoupgradeStatus extends Command {
1717

1818
async run(): Promise<void> {
1919
const enabled = getAutoUpgradeEnabled()
20-
if (enabled === undefined) {
21-
renderInfo({body: autoUpgradeStatus.notConfigured})
22-
} else if (enabled) {
20+
if (enabled) {
2321
renderInfo({body: autoUpgradeStatus.on})
2422
} else {
2523
renderInfo({body: autoUpgradeStatus.off})

0 commit comments

Comments
 (0)