-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add more shim representation tests #2456
Conversation
Guess could be interesting to add for PF set-of-object and list-of-object cases for attributes. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2456 +/- ##
==========================================
- Coverage 56.90% 56.90% -0.01%
==========================================
Files 369 369
Lines 50733 50736 +3
==========================================
+ Hits 28869 28870 +1
- Misses 20285 20288 +3
+ Partials 1579 1578 -1 ☔ View full report in Codecov by Sentry. |
Hmm linter is happy locally but not in CI. Perhaps not aligned on linter versions.
|
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.
Linking #2231 as it covered some of the same grounds and had some interesting observations on similarities/differences between various TF Types represented in the Shim layer.
This PR has been shipped in release v3.92.0. |
This PR simply adds test cases around tfgen and shim representations of various schemata found in SDKv2 and PF. For PF I went through the docs to cover each major advertised case. What's of special interest is pinning down when Pulumi generates object types.
It seems to be happening in two cases:
when TF specifies object types directly in PF:
- Single Nested Attribute
- Object Attribute
- Single Nested Block
when TF specifies a block with MaxItems=1 that is a list or set in TF but is flattened to an object in Pulumi:
- In SDKv2 this is typically a list-nested block with MaxItems=1, very common
- In PF this may be a block with List Validators indicating that at most 1 item is supported; seems rare
It seems helpful to pin down what shim.Schema captures in each of these cases.