-
Notifications
You must be signed in to change notification settings - Fork 225
Add --allow-updates and --allow-delete flags to deploy and release #6749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
81e0dd4 to
76218bc
Compare
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3592 tests passing in 1421 suites. Report generated by 🧪jest coverage report action from d5b37a1 |
76218bc to
d5b37a1
Compare
craigmichaelmartin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment. I think generally in our documentation and command descriptions we should add copy advising against using --force and --allow-deletions . We still provide the sharp knifes, but there is certainly a safer approach: use --allow-updates in CI and seeing it's potential failing as a feature, giving you the mandate to manually deploy when doing potentially highly destructive actions. That is the approach our first party apps will use (EG checkout blocks which was the catalyst for this) and I think we should steer developers to it as well.
| if (!flags['no-release']) { | ||
| const hasAnyForceFlags = flags.force || flags['allow-updates'] || flags['allow-deletes'] | ||
| if (!hasAnyForceFlags) { | ||
| requiredNonTTYFlags.push('force') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user is running shopify app deploy in non-TTY, I think our guidance should be to instruct them to add --allow-updates (not --force).
| const requiredNonTTYFlags: string[] = [] | ||
| const hasAnyForceFlags = flags.force || flags['allow-updates'] || flags['allow-deletes'] | ||
| if (!hasAnyForceFlags) { | ||
| requiredNonTTYFlags.push('force') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for @craigmichaelmartin's comment on the recommended flag.
| if (allowDeletes && !hasUpdates) return true | ||
|
|
||
| // If we're in non-TTY mode and there are changes that require confirmation, throw an error | ||
| if (!isTTY() && (hasDeletes || hasUpdates)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be specific in this error message about what the required flag is here, based on what changed.
WHY are these changes introduced?
Fixes https://github.com/shop/issues-develop/issues/21805
WHAT is this pull request doing?
Add new flags to app deploy and app release:
--allow-updateswould allow for adding and updating extensions and configuration without user prompt. It should be required for any non-interactive release.--allow-deleteswould allow for removing configuration and extensions without user prompt. It should be required for any non-interactive release which has removed configuration or extensions.Also,
deploy --no-releasedoes no longer require--force.How to test your changes?
Add/update/remove a extension or a config field like
embedded = falseunder[pos], and then try to deploy and release in different ways:CI=1--force--allow-updatesand/or--allow-deletesMeasuring impact
How do we know this change was effective? Please choose one:
Checklist