Skip to content

[Phase 0] Deprecate --force on app deploy and app release#6993

Merged
alfonso-noriega merged 6 commits intomainfrom
03-12-deprecate_force_flag_on_deploy_and_release
Mar 20, 2026
Merged

[Phase 0] Deprecate --force on app deploy and app release#6993
alfonso-noriega merged 6 commits intomainfrom
03-12-deprecate_force_flag_on_deploy_and_release

Conversation

@alfonso-noriega
Copy link
Contributor

@alfonso-noriega alfonso-noriega commented Mar 12, 2026

Summary

Adds a deprecation warning when --force / -f is used on app deploy and app release. The flag will be removed in Shopify CLI 4.0.

  • Renders a renderWarning in run() immediately after flag parsing on both commands
  • Covers both explicit --force and SHOPIFY_FLAG_FORCE=1 env var (oclif resolves env vars into flags.force)
  • Updates flag description to note the deprecation
  • Adds a changeset (patch)
  • New command-level test files for both commands (8 tests total, all passing)

dorce_deprecation_warning.png

Migration path

Before After
shopify app deploy --force shopify app deploy --allow-updates --allow-deletes
shopify app deploy --force (CI, no deletes) shopify app deploy --allow-updates
SHOPIFY_FLAG_FORCE=1 SHOPIFY_FLAG_ALLOW_UPDATES=1
shopify app release --force shopify app release --allow-updates --allow-deletes

Test plan

  • pnpm vitest run src/cli/commands/app/deploy.test.ts src/cli/commands/app/release.test.ts — 8/8 pass
  • Full @shopify/app test suite — 190 files, 1894 tests, all pass

Tracking

🤖 Generated with Claude Code

@alfonso-noriega alfonso-noriega requested review from a team as code owners March 12, 2026 16:50
@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.22% 14975/18214
🟡 Branches 74.7% 7416/9928
🟢 Functions 81.22% 3771/4643
🟢 Lines 82.63% 14162/17140

Test suite run success

3920 tests passing in 1506 suites.

Report generated by 🧪jest coverage report action from 8889ed3

Copy link
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of testing notes.

@alfonso-noriega alfonso-noriega marked this pull request as draft March 13, 2026 09:02
@alfonso-noriega alfonso-noriega marked this pull request as ready for review March 13, 2026 16:30
Comment on lines 30 to 34
description:
'Deploy without asking for confirmation. Equivalent to --allow-updates --allow-deletes. For CI/CD environments, the recommended flag is --allow-updates.',
'[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',
}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A flag in Oclif can be marked as deprecated natively.

deprecated: true
// or
deprecated: {message....}

not sure how it looks like, but worth checking it out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigated it — oclif's native deprecated flag calls this.warn() which outputs plain text to stderr. Our renderWarning gives the styled box that's consistent with all other deprecation warnings in the Shopify CLI. There's also no existing precedent for the oclif approach in this codebase, so keeping renderWarning felt like the right call for UX consistency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, wonder if this is something that can be generalized in the BaseCommand though!

dynamically look if you are using deprecated flags and show a custom message.
It will provide a generic way for other teams to use

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 This extraction would be a good follow-up.

@alfonso-noriega alfonso-noriega force-pushed the 03-12-deprecate_force_flag_on_deploy_and_release branch from 0f7035f to 22bda3d Compare March 18, 2026 10:38
Copy link
Contributor Author

alfonso-noriega commented Mar 18, 2026

@dmerand dmerand added the App Platform Theory Big moments in the app platform history, to build historical context label Mar 18, 2026
@alfonso-noriega alfonso-noriega force-pushed the 03-12-deprecate_force_flag_on_deploy_and_release branch from 22bda3d to b8bd1d7 Compare March 19, 2026 10:54
alfonso-noriega and others added 6 commits March 20, 2026 10:06
Add a deprecation warning when --force / -f is used on app deploy and
app release. The flag will be removed in Shopify CLI 4.0. Users should
migrate to --allow-updates (for CI/CD) or --allow-updates --allow-deletes
(when removals are also needed). The SHOPIFY_FLAG_FORCE env var is covered
by the same check since oclif resolves it into flags.force.

Closes shop/issues-develop#22362

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace "Shopify CLI 4.0" with "a future major release" across the
deprecation warning, tests, and changeset to avoid leaking roadmap
details in the public repository.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pe, refresh oclif manifests

- Rename 'does not show deprecation warning when only --allow-deletes is passed' to correctly
  reflect its args (--allow-updates --allow-deletes) in deploy.test.ts
- Add separate test for --allow-deletes alone in deploy.test.ts
- Fix duplicate --allow-updates test in release.test.ts (now tests --allow-updates --allow-deletes)
- Fix Organization object literal: remove non-existent fields (website, apps, zeroPartyData,
  appsNext) and add required 'source' field in both test files
- Regenerate oclif.manifest.json and README.md via pnpm refresh-manifests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
LoadedAppContextOutput requires a specifications field. Added specifications: []
to the mock in both deploy.test.ts and release.test.ts to fix the type-check CI failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
LoadedAppContextOutput requires a specifications field. Added specifications: []
to the mock in both deploy.test.ts and release.test.ts to fix the type-check CI failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alfonso-noriega alfonso-noriega force-pushed the 03-12-deprecate_force_flag_on_deploy_and_release branch from b8bd1d7 to 8889ed3 Compare March 20, 2026 09:06
@alfonso-noriega alfonso-noriega added this pull request to the merge queue Mar 20, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 20, 2026
@alfonso-noriega alfonso-noriega added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit aae6d16 Mar 20, 2026
30 checks passed
@alfonso-noriega alfonso-noriega deleted the 03-12-deprecate_force_flag_on_deploy_and_release branch March 20, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App Platform Theory Big moments in the app platform history, to build historical context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants