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
feat: version blocking for CLI #8737
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8737 +/- ##
==========================================
+ Coverage 56.93% 56.96% +0.02%
==========================================
Files 756 757 +1
Lines 42255 42321 +66
Branches 8653 8675 +22
==========================================
+ Hits 24059 24108 +49
- Misses 17375 17392 +17
Partials 821 821
Continue to review full report at Codecov.
|
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.
LGTM, just one nit
…ws-amplify#8747)" This reverts commit 2d5110c.
This reverts commit b92cd32.
* Revert "fix(amplify-category-auth): added username attributes to configure sms (#8624)" This reverts commit adb70b1. * Revert "Model vnext unit test update (#8749)" This reverts commit 8a308a8. * Revert "Revert "feat: version blocking for CLI (#8737)" (#8747)" This reverts commit 2d5110c. * Revert "chore: update aws-sdk, cdk, typescript dependency, regen yarn.lock (#8739)" This reverts commit d8065a8. * Revert "feat: version blocking for CLI (#8737)" This reverts commit b92cd32. * Revert "Remove pipelineFunction references in favor of resolvers (#8729)" This reverts commit a0295aa. * Revert "fix: move @model params to root stack and fix ds logical id (#8736)" This reverts commit df4408c. * Revert "fix(amplify-provider-awscloudformation): use amplify prompts for warnings (#8731)" This reverts commit 98840ec.
…ws-amplify#8747)" This reverts commit 2d5110c.
This reverts commit b92cd32.
Description of changes
This PR adds a version blocking functionality to the CLI to guard against unwanted or unexpected results when a modification (add, remove, push, etc) operation would be executed against a project that was already pushed by a newer version of the CLI.
From now on Amplify CLI defines a minimumCLIVersion in its package.json file and also emits the same information into the root stack's Metadata section.
The version of the CLI that was used to execute the last push operation, also added to the root stack's Metadata and as a Tag on the stack resources as well.
If the CLI after checking the versions determine that the currently running CLI version has a lower version number it will exit the process.
There are certain commands that does not enforce this version check like amplify version or amplify env list.
If the version check should be bypassed for some reason, defining the AMPLIFY_CLI_DISABLE_VERSION_CHECK environment variable with any value will enable this.
Issue #, if available
N/A
Description of how you validated changes
Added unit tests to test the various parts of the new functionality
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.