Skip to content

Commit e126ffb

Browse files
Remove deprecated --force flag from shopify app deploy
The --force (-f) flag and SHOPIFY_FLAG_FORCE env var on `shopify app deploy` were deprecated in favor of --allow-updates / --allow-deletes. This change removes them along with the related deprecation warning and tests. The internal `force` variable is preserved (now driven by --no-release) so that --no-release continues to imply allowUpdates/allowDeletes and skips the legacy-extension prompt as before — no behavior change for --no-release users. User-facing copy that referenced --force in error/next-step messages has been updated to point at --allow-updates / --allow-deletes.
1 parent f6cc6e2 commit e126ffb

9 files changed

Lines changed: 21 additions & 126 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/app': major
3+
---
4+
5+
Remove the deprecated `--force` (`-f`) flag and `SHOPIFY_FLAG_FORCE` environment variable from `shopify app deploy`. Use `--allow-updates` for CI/CD environments, or `--allow-updates --allow-deletes` if you also want to allow removals. The `--no-release` flag continues to work and implicitly allows updates and deletes.

docs-shopify.dev/commands/interfaces/app-deploy.interface.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ export interface appdeploy {
2828
*/
2929
'-c, --config <value>'?: string
3030

31-
/**
32-
* [Deprecated] Deploy without asking for confirmation. Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.
33-
* @environment SHOPIFY_FLAG_FORCE
34-
*/
35-
'-f, --force'?: ''
36-
3731
/**
3832
* Optional message that will be associated with this version. This is for internal use only and won't be available externally.
3933
* @environment SHOPIFY_FLAG_MESSAGE

packages/app/src/cli/commands/app/deploy.test.ts

Lines changed: 0 additions & 81 deletions
This file was deleted.

packages/app/src/cli/commands/app/deploy.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {linkedAppContext} from '../../services/app-context.js'
88
import {Flags} from '@oclif/core'
99
import {globalFlags} from '@shopify/cli-kit/node/cli'
1010
import {addPublicMetadata} from '@shopify/cli-kit/node/metadata'
11-
import {renderWarning} from '@shopify/cli-kit/node/ui'
1211

1312
export default class Deploy extends AppLinkedCommand {
1413
static summary = 'Deploy your Shopify app.'
@@ -25,13 +24,6 @@ export default class Deploy extends AppLinkedCommand {
2524
static flags = {
2625
...globalFlags,
2726
...appFlags,
28-
force: Flags.boolean({
29-
hidden: false,
30-
description:
31-
'[Deprecated] Deploy without asking for confirmation. Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.',
32-
env: 'SHOPIFY_FLAG_FORCE',
33-
char: 'f',
34-
}),
3527
'allow-updates': Flags.boolean({
3628
hidden: false,
3729
description:
@@ -80,19 +72,6 @@ export default class Deploy extends AppLinkedCommand {
8072
async run(): Promise<AppLinkedCommandOutput> {
8173
const {flags} = await this.parse(Deploy)
8274

83-
if (flags.force) {
84-
renderWarning({
85-
headline: ['The', {command: '--force'}, 'flag is deprecated and will be removed in the next major release.'],
86-
body: [
87-
'Use',
88-
{command: '--allow-updates'},
89-
'for CI/CD environments, or',
90-
{command: '--allow-updates --allow-deletes'},
91-
'if you also want to allow removals.',
92-
],
93-
})
94-
}
95-
9675
await metadata.addPublicMetadata(() => ({
9776
cmd_deploy_flag_message_used: Boolean(flags.message),
9877
cmd_deploy_flag_version_used: Boolean(flags.version),
@@ -108,9 +87,9 @@ export default class Deploy extends AppLinkedCommand {
10887
cmd_app_reset_used: flags.reset,
10988
}))
11089

111-
const force = flags.force || flags['no-release']
90+
const force = flags['no-release']
11291

113-
// When releasing, we require --force or --allow-updates or --allow-deletes for non-TTY.
92+
// When releasing, we require --no-release or --allow-updates or --allow-deletes for non-TTY.
11493
const requiredNonTTYFlags: string[] = []
11594
const hasAnyForceFlags = force || flags['allow-updates'] || flags['allow-deletes']
11695
if (!hasAnyForceFlags) {

packages/app/src/cli/prompts/deploy-release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function shouldSkipConfirmationPrompt({
5858
extensionIdentifiersBreakdown: ExtensionIdentifiersBreakdown
5959
configExtensionIdentifiersBreakdown?: ConfigExtensionIdentifiersBreakdown
6060
}): boolean {
61-
// --force is equivalent to --allow-updates --allow-deletes
61+
// --no-release (which sets force=true internally) is equivalent to --allow-updates --allow-deletes
6262
if (force || (allowUpdates && allowDeletes)) return true
6363

6464
const hasDeletedExtensions = extensionIdentifiersBreakdown.onlyRemote.length > 0

packages/app/src/cli/prompts/uid-mapping-error.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export function throwUidMappingError() {
66
'You must first map IDs to your existing extensions by running',
77
{command: 'shopify app deploy'},
88
'interactively, without',
9-
{command: '--force'},
9+
{command: '--allow-updates'},
10+
'or',
11+
{command: '--allow-deletes'},
1012
', to finish the migration.',
1113
]
1214
const customSection = {

packages/app/src/cli/services/context.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,15 @@ async function checkIncludeConfigOnDeploy({
220220
{command: 'include_config_on_deploy'},
221221
'in your TOML file. Including configuration will be required very soon.',
222222
]
223-
const nextSteps = ['Run', {command: 'shopify app deploy'}, 'interactively, without', {command: '--force'}, '.']
223+
const nextSteps = [
224+
'Run',
225+
{command: 'shopify app deploy'},
226+
'interactively, without',
227+
{command: '--allow-updates'},
228+
'or',
229+
{command: '--allow-deletes'},
230+
'.',
231+
]
224232
throw new AbortError(message, nextSteps)
225233
}
226234

packages/cli/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,12 @@ Deploy your Shopify app.
342342

343343
```
344344
USAGE
345-
$ shopify app deploy [--client-id <value> | -c <value>] [-f] [--message <value>] [--no-build] [--no-color]
345+
$ shopify app deploy [--client-id <value> | -c <value>] [--message <value>] [--no-build] [--no-color]
346346
[--no-release | --allow-updates | --allow-deletes] [--path <value>] [--reset | ] [--source-control-url <value>]
347347
[--verbose] [--version <value>]
348348
349349
FLAGS
350350
-c, --config=<value> [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration.
351-
-f, --force [env: SHOPIFY_FLAG_FORCE] [Deprecated] Deploy without asking for confirmation.
352-
Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD
353-
environments instead.
354351
--allow-deletes [env: SHOPIFY_FLAG_ALLOW_DELETES] Allows removing extensions and configuration
355352
without requiring user confirmation. For CI/CD environments, the recommended flag is
356353
--allow-updates.

packages/cli/oclif.manifest.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -793,15 +793,6 @@
793793
"name": "config",
794794
"type": "option"
795795
},
796-
"force": {
797-
"allowNo": false,
798-
"char": "f",
799-
"description": "[Deprecated] Deploy without asking for confirmation. Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.",
800-
"env": "SHOPIFY_FLAG_FORCE",
801-
"hidden": false,
802-
"name": "force",
803-
"type": "boolean"
804-
},
805796
"message": {
806797
"description": "Optional message that will be associated with this version. This is for internal use only and won't be available externally.",
807798
"env": "SHOPIFY_FLAG_MESSAGE",

0 commit comments

Comments
 (0)