-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[codegen/go] allow plain default types #8254
Conversation
Diff for pulumi-random with merge commit 7fa43bd |
Diff for pulumi-azuread with merge commit 7fa43bd |
Diff for pulumi-kubernetes with merge commit 7fa43bd |
Diff for pulumi-gcp with merge commit 7fa43bd |
Diff for pulumi-random with merge commit 7549f03 |
Diff for pulumi-azuread with merge commit 7549f03 |
Diff for pulumi-kubernetes with merge commit 7549f03 |
Diff for pulumi-random with merge commit f54517a |
Diff for pulumi-azuread with merge commit f54517a |
Diff for pulumi-aws with merge commit 7fa43bd |
Diff for pulumi-gcp with merge commit 7549f03 |
Diff for pulumi-kubernetes with merge commit f54517a |
Diff for pulumi-gcp with merge commit f54517a |
Diff for pulumi-azure with merge commit 7fa43bd |
Diff for pulumi-aws with merge commit 7549f03 |
Diff for pulumi-aws with merge commit f54517a |
Diff for pulumi-azure with merge commit 7549f03 |
Diff for pulumi-azure with merge commit f54517a |
Diff for pulumi-gcp with merge commit efb7424 |
Diff for pulumi-aws with merge commit efb7424 |
Diff for pulumi-azure with merge commit efb7424 |
Diff for pulumi-azure-native with merge commit efb7424 |
Diff for pulumi-azuread with merge commit 500d74e |
Diff for pulumi-random with merge commit 500d74e |
@t0yv0 I personally prefer the original approach, mostly because of the type safety that you mentioned. Generating the types manually (as opposed to inferring them) might be more error prone, but it will incur compile time errors instead of runtime errors. That means we need only compile each generated SDK to be sure it will work. I think this is overall safer (less likely to ship users invalid code). I would be curious to what others think though. BTW: I appreciate you taking the time to come up with what you did. It is definitely an idea worth considering. |
Diff for pulumi-kubernetes with merge commit 500d74e |
Diff for pulumi-gcp with merge commit 500d74e |
Diff for pulumi-azure with merge commit 500d74e |
Diff for pulumi-aws with merge commit 500d74e |
Diff for pulumi-azure-native with merge commit 500d74e |
@iwahbe generally I err on the type safety side also; the reasons to exploring reflection more:
Reflection is just the only kind of rope Go gives us that can possibly give us the ability to move code out of concrete contexts (specific resources) into the general contexts (SDK) achieving abstraction/code compression. |
Please go ahead with your PR, we just may return to the reflection conversation later on when revisiting the Go SDK design principles in some broader context. |
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
RE: alternative approach: FWIW, my preference is to keep the original approach for this PR, but I very much appreciate the exploration on the alternative approach. Definitely something to consider and keep in mind as we look for ways to reduce the size of the generated SDKs. |
Apologies for chiming in late here--between being OOF and being sick, I've fallen pretty far behind in code reviews. Just to check my understanding: it looks like with these changes we will generate a |
Diff for pulumi-random with merge commit 0face74 |
Diff for pulumi-azuread with merge commit 0face74 |
Diff for pulumi-kubernetes with merge commit 0face74 |
Diff for pulumi-gcp with merge commit 0face74 |
Diff for pulumi-aws with merge commit 0face74 |
Diff for pulumi-azure with merge commit 0face74 |
Diff for pulumi-azure-native with merge commit 0face74 |
Description
Help
go
combine theplain
anddefault
schema fields.Fixes #7196
Checklist