[Phase 0] Deprecate --force on app deploy and app release#6993
[Phase 0] Deprecate --force on app deploy and app release#6993alfonso-noriega merged 6 commits intomainfrom
Conversation
Coverage report
Test suite run success3920 tests passing in 1506 suites. Report generated by 🧪jest coverage report action from 8889ed3 |
| 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', | ||
| }), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
+1 This extraction would be a good follow-up.
0f7035f to
22bda3d
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
22bda3d to
b8bd1d7
Compare
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>
b8bd1d7 to
8889ed3
Compare

Summary
Adds a deprecation warning when
--force/-fis used onapp deployandapp release. The flag will be removed in Shopify CLI 4.0.renderWarninginrun()immediately after flag parsing on both commands--forceandSHOPIFY_FLAG_FORCE=1env var (oclif resolves env vars intoflags.force)descriptionto note the deprecationpatch)Migration path
shopify app deploy --forceshopify app deploy --allow-updates --allow-deletesshopify app deploy --force(CI, no deletes)shopify app deploy --allow-updatesSHOPIFY_FLAG_FORCE=1SHOPIFY_FLAG_ALLOW_UPDATES=1shopify app release --forceshopify app release --allow-updates --allow-deletesTest plan
pnpm vitest run src/cli/commands/app/deploy.test.ts src/cli/commands/app/release.test.ts— 8/8 pass@shopify/apptest suite — 190 files, 1894 tests, all passTracking
🤖 Generated with Claude Code