-
Notifications
You must be signed in to change notification settings - Fork 52
feat(toolkit-lib): fallBackToTemplate option for diffs #354
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
Conversation
| * | ||
| * @default true | ||
| */ | ||
| fallBackToTemplate?: boolean; |
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.
This doesn't seem to be added on a type that is only used for the diff operation.
For example, resourcesToImport definitely should not be part of the diff operation. Can't we place fallBackToTemplate elsewhere?
And if it is the case that uploadBodyParameterAndCreateChangeSet is also used in cdk import, then the error message "we will fall back to a template diff" doesn't make any sense.
Can you categorize the uses of this function a bit better?
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.
right now, createDiffChangeSet is the only one that uses PrepareChangeSetOptions. uploadBodyParameterAndCreateChangeSet is a helper method of createDiffChangeSet and not exposed or used elsewhere. and in turn, createDiffChangeSet is only used in the diff operation -- i believe it's meant to be diff specific. The error message / IOHost messages have existed previously, and are diff specific. are you asking me to refactor uploadBodyParameterAndCreateChangeSet to be more generic so that it may be used in cdk import in the future? i'd rather not in this PR.
would it be better if I renamed fallBackToTemplate as a more generic failOnError?
The primary motivation for this PR is #914 and the ensuing PR aws/aws-cdk#32830.
When implementing diff in the programmatic toolkit library we included the diff method options, and this PR adds the
fallBackToTemplateproperty to theChangeSetmode. The idea is that people can specifyfallBackToTemplate=falseto explicitly fail if we cannot successfully create the changeset. The current behavior is to fallback to the template-only method.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license