-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Switched to API field name as primary metadata #14711
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
Switched to API field name as primary metadata #14711
Conversation
This allows us to preserve the exact API field name in metadata while still being able to programmatically derive the terraform field name. Since conversion to terraform name is lossy, we can't reliably go the other direction.
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
roaks3
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.
I think we may want to update docs/content/reference/metadata.md, at least slightly. api_field will now be camelcased, and I assume field will default to the snakecased version of api_field?
Also:
Since conversion to terraform name is lossy, we can't reliably go the other direction
Could you clarify, or possibly have an example to share?
Everything else LGTM (including a scan of the results)
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Done. Yes, those are the changes.
Conversion to terraform name uses this function: magic-modules/mmv1/google/string_utils.go Lines 27 to 34 in 4e1621c
It looks like we don't have any fields that contain However, we can't tell the difference between fields like |
roaks3
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.
However, we can't tell the difference between fields like IPAddress vs IpAddress - both would be converted to ip_address. Examples: InterconnectAttachment has cloudRouterIpAddress, but RegionBackendService has fastIPMove.
Ah right, the acronym handling makes it lossy. Thanks for explaining!
42b9e5c
This allows us to preserve the exact API field name in metadata while still being able to programmatically derive the terraform field name. Since conversion to terraform name is lossy, we can't reliably go the other direction.
This PR only handles generated meta.yaml files. If this approach works, I'll handle the handwritten files separately later.
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.