-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 field-level metadata generation for mmv1 resources #12792
base: main
Are you sure you want to change the base?
Conversation
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.
|
func (r Resource) LeafProperties() []*Type { | ||
types := r.AllNestedProperties(google.Concat(r.RootProperties(), r.UserVirtualFields())) | ||
|
||
// Remove types that have children, becasue we only want "leaf" fields |
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.
sp - feel free to ignore
// Remove types that have children, becasue we only want "leaf" fields | |
// Remove types that have children, because we only want "leaf" fields |
@@ -198,3 +198,105 @@ func TestResourceServiceVersion(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestLeafProperties(t *testing.T) { |
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.
would it be useful to have tests for non-nested leaf properties to cover the base case?
- | ||
field: '{{ $p.MetadataLineage }}' |
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 this newline isn't necessary / isn't how we generally format our yaml. It adds a lot of whitespace to the yaml file.
- | |
field: '{{ $p.MetadataLineage }}' | |
- field: '{{ $p.MetadataLineage }}' |
This is the initial pass at adding field metadata to all mmv1 resources. I was able to check a small set of resources for accuracy, but further accuracy improvements are expected to come after we have the data ingested and can more clearly run checks.
Notable decisions:
api_field
default to the value offield
when it isn't specified, so that it does not need to be included for the vast majority of fields. This massively reduces the size and visual noise in metadata files, which will be helpful for handwritten resources later.key
/value
metadata fields for maps, even though that is how they are described in the API, because it isn't meaningful for coverage. Maps are treated like a single field.Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.