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

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

/**
* Optional message that will be associated with this version. This is for internal use only and won't be available externally.
* @environment SHOPIFY_FLAG_MESSAGE
Expand Down
81 changes: 0 additions & 81 deletions packages/app/src/cli/commands/app/deploy.test.ts

This file was deleted.

25 changes: 2 additions & 23 deletions packages/app/src/cli/commands/app/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,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 Deploy extends AppLinkedCommand {
static summary = 'Deploy your Shopify app.'
Expand All @@ -25,13 +24,6 @@ export default class Deploy extends AppLinkedCommand {
static flags = {
...globalFlags,
...appFlags,
force: Flags.boolean({
hidden: false,
description:
'[Deprecated] Deploy 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 Down Expand Up @@ -80,19 +72,6 @@ export default class Deploy extends AppLinkedCommand {
async run(): Promise<AppLinkedCommandOutput> {
const {flags} = await this.parse(Deploy)

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 metadata.addPublicMetadata(() => ({
cmd_deploy_flag_message_used: Boolean(flags.message),
cmd_deploy_flag_version_used: Boolean(flags.version),
Expand All @@ -108,9 +87,9 @@ export default class Deploy extends AppLinkedCommand {
cmd_app_reset_used: flags.reset,
}))

const force = flags.force || flags['no-release']
const force = flags['no-release']

// When releasing, we require --force or --allow-updates or --allow-deletes for non-TTY.
// When releasing, we require --no-release or --allow-updates or --allow-deletes for non-TTY.
const requiredNonTTYFlags: string[] = []
const hasAnyForceFlags = force || flags['allow-updates'] || flags['allow-deletes']
if (!hasAnyForceFlags) {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/cli/prompts/deploy-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function shouldSkipConfirmationPrompt({
extensionIdentifiersBreakdown: ExtensionIdentifiersBreakdown
configExtensionIdentifiersBreakdown?: ConfigExtensionIdentifiersBreakdown
}): boolean {
// --force is equivalent to --allow-updates --allow-deletes
// --no-release (which sets force=true internally) is equivalent to --allow-updates --allow-deletes
if (force || (allowUpdates && allowDeletes)) return true

const hasDeletedExtensions = extensionIdentifiersBreakdown.onlyRemote.length > 0
Expand Down
4 changes: 3 additions & 1 deletion packages/app/src/cli/prompts/uid-mapping-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export function throwUidMappingError() {
'You must first map IDs to your existing extensions by running',
{command: 'shopify app deploy'},
'interactively, without',
{command: '--force'},
{command: '--allow-updates'},
'or',
{command: '--allow-deletes'},
', to finish the migration.',
]
const customSection = {
Expand Down
10 changes: 9 additions & 1 deletion packages/app/src/cli/services/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,15 @@ async function checkIncludeConfigOnDeploy({
{command: 'include_config_on_deploy'},
'in your TOML file. Including configuration will be required very soon.',
]
const nextSteps = ['Run', {command: 'shopify app deploy'}, 'interactively, without', {command: '--force'}, '.']
const nextSteps = [
'Run',
{command: 'shopify app deploy'},
'interactively, without',
{command: '--allow-updates'},
'or',
{command: '--allow-deletes'},
'.',
]
throw new AbortError(message, nextSteps)
}

Expand Down
5 changes: 1 addition & 4 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,12 @@ Deploy your Shopify app.

```
USAGE
$ shopify app deploy [--client-id <value> | -c <value>] [-f] [--message <value>] [--no-build] [--no-color]
$ shopify app deploy [--client-id <value> | -c <value>] [--message <value>] [--no-build] [--no-color]
[--no-release | --allow-updates | --allow-deletes] [--path <value>] [--reset | ] [--source-control-url <value>]
[--verbose] [--version <value>]

FLAGS
-c, --config=<value> [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration.
-f, --force [env: SHOPIFY_FLAG_FORCE] [Deprecated] Deploy 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.
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 @@ -793,15 +793,6 @@
"name": "config",
"type": "option"
},
"force": {
"allowNo": false,
"char": "f",
"description": "[Deprecated] Deploy 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"
},
"message": {
"description": "Optional message that will be associated with this version. This is for internal use only and won't be available externally.",
"env": "SHOPIFY_FLAG_MESSAGE",
Expand Down
Loading