-
Notifications
You must be signed in to change notification settings - Fork 12
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
Verify support for returning plain values from YAML methods #499
Labels
Comments
t0yv0
added
kind/enhancement
Improvements or new features
needs-triage
Needs attention from the triage team
labels
Aug 24, 2023
13 tasks
dixler
added
area/providers
and removed
needs-triage
Needs attention from the triage team
labels
Aug 28, 2023
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 17, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 17, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 18, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 18, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 18, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 18, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 18, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 18, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 18, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this issue
Nov 18, 2023
Support returning plain values from methods. Implements Node, Python and Go support. Remaining: - [x] test receiving unknowns - [x] acceptance tests written and passing locally for Node, Python, Go clients against a Go server - [x] acceptance tests passing in CI - [x] tickets filed for remaining languages - [x] pulumi/pulumi-yaml#499 - [x] pulumi/pulumi-java#1193 - [x] pulumi/pulumi-dotnet#170 Known limitations: - this is technically a breaking change in case there is code out there that already uses methods that return Plain: true - struct-wrapping limitation: the provider for the component resource needs to still wrap the plain-returning Method response with a 1-arg struct; by convention the field is named "res", and this is how it travels through the plumbing - resources cannot return plain values yet - the provider for the component resource cannot have unknown configuration, if it does, the methods will not be called - Per Luke #11520 this might not be supported/realizable yet <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12709 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
Issue details
As a provider author I would like to be able to mark methods as plain: true so that my provider's consumers can access their results directly without an Output wrapper.
Further, methods that return a single value only should not be wrapped in a struct, making it as simple as possible to consume.
Methods should be able to return explicit Provider references usable for configuring other resources in the stack, so that methods can be used as factories to simplify complex provider configuration.
Here is a PR implementing plain-valued methods for Node, Python, Go that includes acceptance tests for this feature:
pulumi/pulumi#13592
Borrowing from that PR, the new schema forms is listed below; "tlsProvider" returns a singleton provider reference, "meaningOfLife" returns a singleton integer, and "objectMix" returns both in a struct.
YAML-specific considerations
Since YAML does not require SDK generation and relies on Go SDK under the hood, the feature might just work once Method calls are supported - it is currently blocked on that. However it would be good to verify in particular that the information flows correctly and that provider references returned from factory methods can be used to configure further resources.
Affected area/feature
The text was updated successfully, but these errors were encountered: