-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Singleton support for autogen parser #16057
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
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 hasn't generated any diffs, but I'll let you know if a future commit does. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR hasn't generated any diffs, but I'll let you know if a future commit does. |
c2thorn
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.
looks good overall, asked some questions but nothing that should be blocking
did you have a resource you were testing this against, or at least have a generated example yaml
| resource := buildResource(filePath, name, resource, doc) | ||
| if resource.update == nil { | ||
| continue | ||
| } |
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.
so at this point we are following part 1 of https://googlecloudplatform.github.io/magic-modules/best-practices/common-resource-patterns/
I assume an acquire-on-create template would be possible for singletons, but this primary issue is actually detecting singletons with create endpoints in the first place? Would this be a possible extension later?
| resource.Async.Actions = append(resource.Async.Actions, "update") | ||
| } | ||
|
|
||
| resource.ExcludeDelete = true |
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 is an important singleton-specific inclusion, would it be worth having a comment in the generated yaml pointing to it, or at least any meta indicator of a singleton resource in the generated file at all? We could even slap something into ye olde resource object?
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 suppose somehow we want to indicate to the implementer that we have identified their resource as a singleton
Depends on PATCH as create and excluding delete, hardcodes updateMask=* into the create URL which matches AIP-134
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.