Skip to content

Commit 1b709f5

Browse files
Merge pull request #7521 from Shopify/02-remove-app-release-force-flag
Remove deprecated --force flag from `shopify app release`
2 parents 304f898 + c36d5c2 commit 1b709f5

6 files changed

Lines changed: 14 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 release`. Use `--allow-updates` for CI/CD environments, or `--allow-updates --allow-deletes` if you also want to allow removals. Passing both `--allow-updates` and `--allow-deletes` skips the confirmation prompt (matching the previous `--force` behavior).

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

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

31-
/**
32-
* [Deprecated] Release 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
* Disable color output.
3933
* @environment SHOPIFY_FLAG_NO_COLOR

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

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

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

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {linkedAppContext} from '../../services/app-context.js'
55
import {Flags} from '@oclif/core'
66
import {globalFlags} from '@shopify/cli-kit/node/cli'
77
import {addPublicMetadata} from '@shopify/cli-kit/node/metadata'
8-
import {renderWarning} from '@shopify/cli-kit/node/ui'
98

109
export default class Release extends AppLinkedCommand {
1110
static summary = 'Release an app version.'
@@ -19,13 +18,6 @@ export default class Release extends AppLinkedCommand {
1918
static flags = {
2019
...globalFlags,
2120
...appFlags,
22-
force: Flags.boolean({
23-
hidden: false,
24-
description:
25-
'[Deprecated] Release without asking for confirmation. Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.',
26-
env: 'SHOPIFY_FLAG_FORCE',
27-
char: 'f',
28-
}),
2921
'allow-updates': Flags.boolean({
3022
hidden: false,
3123
description:
@@ -50,27 +42,19 @@ export default class Release extends AppLinkedCommand {
5042
const {flags} = await this.parse(Release)
5143
const clientId = flags['client-id']
5244

53-
if (flags.force) {
54-
renderWarning({
55-
headline: ['The', {command: '--force'}, 'flag is deprecated and will be removed in the next major release.'],
56-
body: [
57-
'Use',
58-
{command: '--allow-updates'},
59-
'for CI/CD environments, or',
60-
{command: '--allow-updates --allow-deletes'},
61-
'if you also want to allow removals.',
62-
],
63-
})
64-
}
65-
6645
await addPublicMetadata(() => ({
6746
cmd_app_reset_used: flags.reset,
6847
}))
6948

70-
// We require --force or --allow-updates or --allow-deletes for non-TTY.
49+
const allowUpdates = flags['allow-updates']
50+
const allowDeletes = flags['allow-deletes']
51+
// `force` (skip confirmation prompt) is implied when both --allow-updates
52+
// and --allow-deletes are set.
53+
const force = Boolean(allowUpdates && allowDeletes)
54+
55+
// We require --allow-updates or --allow-deletes for non-TTY.
7156
const requiredNonTTYFlags: string[] = []
72-
const hasAnyForceFlags = flags.force || flags['allow-updates'] || flags['allow-deletes']
73-
if (!hasAnyForceFlags) {
57+
if (!allowUpdates && !allowDeletes) {
7458
requiredNonTTYFlags.push('allow-updates')
7559
}
7660
this.failMissingNonTTYFlags(flags, requiredNonTTYFlags)
@@ -82,14 +66,11 @@ export default class Release extends AppLinkedCommand {
8266
userProvidedConfigName: flags.config,
8367
})
8468

85-
const allowUpdates = flags.force || flags['allow-updates']
86-
const allowDeletes = flags.force || flags['allow-deletes']
87-
8869
await release({
8970
app,
9071
remoteApp,
9172
developerPlatformClient,
92-
force: flags.force,
73+
force,
9374
allowUpdates,
9475
allowDeletes,
9576
version: flags.version,

packages/cli/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,6 @@ USAGE
928928
929929
FLAGS
930930
-c, --config=<value> [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration.
931-
-f, --force [env: SHOPIFY_FLAG_FORCE] [Deprecated] Release without asking for confirmation. Equivalent to
932-
--allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.
933931
--allow-deletes [env: SHOPIFY_FLAG_ALLOW_DELETES] Allows removing extensions and configuration without
934932
requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates.
935933
--allow-updates [env: SHOPIFY_FLAG_ALLOW_UPDATES] Allows adding and updating extensions and configuration

packages/cli/oclif.manifest.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2863,15 +2863,6 @@
28632863
"name": "config",
28642864
"type": "option"
28652865
},
2866-
"force": {
2867-
"allowNo": false,
2868-
"char": "f",
2869-
"description": "[Deprecated] Release without asking for confirmation. Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.",
2870-
"env": "SHOPIFY_FLAG_FORCE",
2871-
"hidden": false,
2872-
"name": "force",
2873-
"type": "boolean"
2874-
},
28752866
"no-color": {
28762867
"allowNo": false,
28772868
"description": "Disable color output.",

0 commit comments

Comments
 (0)