Skip to content
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: Implement pux.Input[T] for generated types #13510

Merged
merged 2 commits into from Aug 28, 2023

Conversation

abhinav
Copy link
Contributor

@abhinav abhinav commented Jul 17, 2023

For generated types that impleemnt pulumi.Output,
or those that implement pulumi.Input with a means of converting
themselves to a pulumi.Output,
also generate ToOutput(context.Context) pux.Output[..]
to satisfy the pux.Input[T] interface.

This allows all these generated types to be used with pux.Apply
and other type-safe generic APIs per #13057.

Resolves #13587

Copy link
Contributor Author

abhinav commented Jul 17, 2023

@pulumi-bot
Copy link
Contributor

pulumi-bot commented Jul 17, 2023

Changelog

[uncommitted] (2023-08-28)

Features

  • [sdkgen/go] Generate types that are compatible with sdk/go/pulumix's type-safe APIs.
    #13510

@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch from 80476a2 to 89c5dbb Compare July 17, 2023 18:00
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from 643aafb to 3025e09 Compare July 17, 2023 18:00
@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch 2 times, most recently from e69fbc1 to 3e986a3 Compare July 18, 2023 21:22
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from 3025e09 to 4693c45 Compare July 18, 2023 21:22
@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch from 3e986a3 to 569046b Compare July 18, 2023 23:18
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from 4693c45 to 975d25c Compare July 18, 2023 23:18
@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch from 569046b to b8d4da5 Compare July 18, 2023 23:54
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from 975d25c to fa66217 Compare July 18, 2023 23:55
@abhinav abhinav changed the title codegen/go: Implement pux.Input[T] for generated types codegen/go/testdata: Regenerate code Jul 18, 2023
@abhinav abhinav changed the title codegen/go/testdata: Regenerate code codegen/go: Implement pux.Input[T] for generated types Jul 18, 2023
@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch from b8d4da5 to eec7d43 Compare July 25, 2023 18:08
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from fa66217 to eb75b35 Compare July 25, 2023 18:08
@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch from eec7d43 to 7ff4b2c Compare July 25, 2023 19:16
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from eb75b35 to 154ebe8 Compare July 25, 2023 19:16
@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch 3 times, most recently from ea90f71 to 4aaad1b Compare July 26, 2023 01:59
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from 154ebe8 to deb416c Compare July 26, 2023 02:11
@abhinav abhinav marked this pull request as ready for review July 26, 2023 02:11
@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch from 4aaad1b to 3019597 Compare July 26, 2023 02:12
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from deb416c to c5629e6 Compare July 26, 2023 02:12
@abhinav abhinav requested a review from a team July 31, 2023 18:42
@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch from 3019597 to 46e40ea Compare August 1, 2023 18:00
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from c5629e6 to 3cdf5c3 Compare August 1, 2023 18:00
Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhinav abhinav force-pushed the abhinav/go-generics-pulumix branch from 2e08486 to d15c02d Compare August 24, 2023 20:48
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from 118e2b6 to 4d67a9b Compare August 24, 2023 20:48
Base automatically changed from abhinav/go-generics-pulumix to master August 28, 2023 16:17
For generated types that impleemnt `pulumi.Output`,
or those that implement `pulumi.Input` with a means of converting
themselves to a `pulumi.Output`,
also generate `ToOutput(context.Context) pux.Output[..]`
to satisfy the `pux.Input[T]` interface.

This allows all these generated types to be used with `pux.Apply`
and other type-safe generic APIs per #13057.

Resolves #13587
Regenerates code based on prior codegen changes.
@abhinav abhinav force-pushed the abhinav/go-generics-codegen branch from 4d67a9b to c71f3b1 Compare August 28, 2023 16:19
@abhinav abhinav enabled auto-merge August 28, 2023 16:19
@abhinav abhinav added this pull request to the merge queue Aug 28, 2023
Merged via the queue into master with commit 025add9 Aug 28, 2023
48 checks passed
@abhinav abhinav deleted the abhinav/go-generics-codegen branch August 28, 2023 17:20
t0yv0 added a commit to pulumi/pulumi-azure-native that referenced this pull request Sep 22, 2023
Recent changes to SDK generation cause ubuntu-latest jobs to fail sporadically, with the likely root
cause being out of resources (disk or memory).

The most likely culprit for additional resource requirements is:

        https://github.com/pulumi/pulumi/releases/tag/v3.80.0

Specifically this feature:

        [sdkgen/go] Generate types that are compatible with sdk/go/pulumix's type-safe APIs (pulumi/pulumi#13510)

The workaround is to use a custom pulumi-ubuntu-8core runner that has more resources available.

Fixes #2767, #2768.
t0yv0 added a commit to pulumi/pulumi-azure-native that referenced this pull request Sep 22, 2023
Recent changes to SDK generation cause ubuntu-latest jobs to fail
sporadically, with the likely root cause being out of resources (disk or
memory).

The most likely culprit for additional resource requirements is:

        https://github.com/pulumi/pulumi/releases/tag/v3.80.0

Specifically this feature:

[sdkgen/go] Generate types that are compatible with sdk/go/pulumix's
type-safe APIs (pulumi/pulumi#13510)

The workaround is to use a custom pulumi-ubuntu-8core runner that has
more resources available.

Fixes #2767, #2768.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Go Generics] sdkgen: Satisfy Input[T] for all generated types [Phase 1]
4 participants