-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(cli): --no-previous-parameters
incorrectly skips updates
#11288
Conversation
The CLI skips performing a CloudFormation deployment when it determines that the deployment will be a no-op (the CLI does this itself instead of deferring to CloudFormation because CloudFormation cannot accurately determine whether a changeset is going to be a no-op if Nested Stacks are involved, and we are looking to improve performance here). One of the aspects the CLI considers (after checking whether the templates are the same) is whether any Parameter values have changed. When `--no-previous-parameters` was passed, the code incorrectly completely ignored the existing Parameter values, which effectively led to it assuming that the "current values" on the stack were the same as the "default values" of the parameters. That meant that if a stack that was previously deployed with specific Parameter values, but then wanted to revert them to the defaults, this analysis would conclude that since the parameter values were equal to the defaults, there was "no change". In hindsight, this is obviously incorrect. The previous values should have been ignored for the purposes of determining the final paramater values and the CloudFormation API call parameters, but *not* for determining whether there is a change in parameter values between the current state of the stack and the new state of the stack.
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.
Looks fine to me, sans what looks like one unused class.
/** | ||
* The values that change between the current and a new deployment | ||
*/ | ||
export class ParameterChanges { |
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 don't see this being referenced anywhere. Vestigial remains?
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.
GD DMN
yes
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.
On one hand, I feel like forcing you to include the integ test fixes in a separate PR. On the other... 🤷
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
The CLI skips performing a CloudFormation deployment when it determines
that the deployment will be a no-op (the CLI does this itself instead of
deferring to CloudFormation because CloudFormation cannot accurately
determine whether a changeset is going to be a no-op if Nested Stacks
are involved, and we are looking to improve performance here).
One of the aspects the CLI considers (after checking whether the
templates are the same) is whether any Parameter values have changed.
When
--no-previous-parameters
was passed, the code incorrectlycompletely ignored the existing Parameter values, which effectively
led to it assuming that the "current values" on the stack were the
same as the "default values" of the parameters.
That meant that if a stack that was previously deployed with specific
Parameter values, but then wanted to revert them to the defaults,
this analysis would conclude that since the parameter values were
equal to the defaults, there was "no change".
In hindsight, this is obviously incorrect. The previous values should
have been ignored for the purposes of determining the final
paramater values and the CloudFormation API call parameters, but not
for determining whether there is a change in parameter values between
the current state of the stack and the new state of the stack.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license