-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
CFn: validate Type is provided
#13524
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
Test Results - Preflight, Unit23 046 tests 21 201 ✅ 6m 25s ⏱️ Results for commit a328b78. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Acceptance7 tests 5 ✅ 2m 57s ⏱️ Results for commit a328b78. ♻️ This comment has been updated with latest results. |
LocalStack Community integration with Pro 2 files 2 suites 29m 36s ⏱️ Results for commit a328b78. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 42m 33s ⏱️ Results for commit a328b78. ♻️ This comment has been updated with latest results. |
Test Results - Alternative Providers584 tests 325 ✅ 18m 5s ⏱️ Results for commit a328b78. ♻️ This comment has been updated with latest results. |
b70b887 to
2c735e7
Compare
| if is_nothing(node_resource.type_.value): | ||
| raise ValidationError( | ||
| f"Template format error: [{node_resource.scope}] Every Resources object must contain a Type member." | ||
| ) |
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.
Why is this validation not added to the Preproc like the rest?
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.
Because it must operate on the transformed template and if we implement this in the preproc then it will trigger on the pre transformed template if it has eg a transform like include.
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.
See that ci is failing now after making your suggestion
# Motivation While discusing #13496 I asserted that we can safely access `resource["Type"]` in the visitors since we validate that the `Type` key is always present. However this _was not true_! This PR resolves this # Changes * Add test deploying resource without a `Type` key * Validate that the type is present during the modelling phase
2c735e7 to
32fc1e3
Compare
This reverts commit 32fc1e3.
pinzon
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.
Thanks for testing the suggestion 👍
Motivation
While discusing #13496 I asserted that we can safely access
resource["Type"]in the visitors since we validate that theTypekey is always present. However this was not true! This PR resolves thisChanges
Typekey