Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/remove-app-release-force-flag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/app': major
---

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).
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ export interface apprelease {
*/
'-c, --config <value>'?: string

/**
* [Deprecated] Release without asking for confirmation. Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.
* @environment SHOPIFY_FLAG_FORCE
*/
'-f, --force'?: ''

/**
* Disable color output.
* @environment SHOPIFY_FLAG_NO_COLOR
Expand Down
81 changes: 0 additions & 81 deletions packages/app/src/cli/commands/app/release.test.ts

This file was deleted.

37 changes: 9 additions & 28 deletions packages/app/src/cli/commands/app/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {linkedAppContext} from '../../services/app-context.js'
import {Flags} from '@oclif/core'
import {globalFlags} from '@shopify/cli-kit/node/cli'
import {addPublicMetadata} from '@shopify/cli-kit/node/metadata'
import {renderWarning} from '@shopify/cli-kit/node/ui'

export default class Release extends AppLinkedCommand {
static summary = 'Release an app version.'
Expand All @@ -19,13 +18,6 @@ export default class Release extends AppLinkedCommand {
static flags = {
...globalFlags,
...appFlags,
force: Flags.boolean({
hidden: false,
description:
'[Deprecated] Release without asking for confirmation. Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.',
env: 'SHOPIFY_FLAG_FORCE',
char: 'f',
}),
'allow-updates': Flags.boolean({
hidden: false,
description:
Expand All @@ -50,27 +42,19 @@ export default class Release extends AppLinkedCommand {
const {flags} = await this.parse(Release)
const clientId = flags['client-id']

if (flags.force) {
renderWarning({
headline: ['The', {command: '--force'}, 'flag is deprecated and will be removed in the next major release.'],
body: [
'Use',
{command: '--allow-updates'},
'for CI/CD environments, or',
{command: '--allow-updates --allow-deletes'},
'if you also want to allow removals.',
],
})
}

await addPublicMetadata(() => ({
cmd_app_reset_used: flags.reset,
}))

// We require --force or --allow-updates or --allow-deletes for non-TTY.
const allowUpdates = flags['allow-updates']
const allowDeletes = flags['allow-deletes']
// `force` (skip confirmation prompt) is implied when both --allow-updates
// and --allow-deletes are set.
const force = Boolean(allowUpdates && allowDeletes)

// We require --allow-updates or --allow-deletes for non-TTY.
const requiredNonTTYFlags: string[] = []
const hasAnyForceFlags = flags.force || flags['allow-updates'] || flags['allow-deletes']
if (!hasAnyForceFlags) {
if (!allowUpdates && !allowDeletes) {
requiredNonTTYFlags.push('allow-updates')
}
this.failMissingNonTTYFlags(flags, requiredNonTTYFlags)
Expand All @@ -82,14 +66,11 @@ export default class Release extends AppLinkedCommand {
userProvidedConfigName: flags.config,
})

const allowUpdates = flags.force || flags['allow-updates']
const allowDeletes = flags.force || flags['allow-deletes']

await release({
app,
remoteApp,
developerPlatformClient,
force: flags.force,
force,
allowUpdates,
allowDeletes,
version: flags.version,
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,6 @@ USAGE

FLAGS
-c, --config=<value> [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration.
-f, --force [env: SHOPIFY_FLAG_FORCE] [Deprecated] Release without asking for confirmation. Equivalent to
--allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.
--allow-deletes [env: SHOPIFY_FLAG_ALLOW_DELETES] Allows removing extensions and configuration without
requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates.
--allow-updates [env: SHOPIFY_FLAG_ALLOW_UPDATES] Allows adding and updating extensions and configuration
Expand Down
9 changes: 0 additions & 9 deletions packages/cli/oclif.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2863,15 +2863,6 @@
"name": "config",
"type": "option"
},
"force": {
"allowNo": false,
"char": "f",
"description": "[Deprecated] Release without asking for confirmation. Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD environments instead.",
"env": "SHOPIFY_FLAG_FORCE",
"hidden": false,
"name": "force",
"type": "boolean"
},
"no-color": {
"allowNo": false,
"description": "Disable color output.",
Expand Down
Loading