Commit Graph

13 Commits

Author SHA1 Message Date
Anton Tayanovskyy ba039c20f8
Support returning plain values from methods ()
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] https://github.com/pulumi/pulumi-yaml/issues/499
   - [x] https://github.com/pulumi/pulumi-java/issues/1193
   - [x] https://github.com/pulumi/pulumi-dotnet/issues/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 https://github.com/pulumi/pulumi/issues/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 https://github.com/pulumi/pulumi/issues/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. -->
2023-11-18 06:02:06 +00:00
Fraser Waters 423e1b7743
Remove NodeJS and Python install scripts ()
<!--- 
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 https://github.com/pulumi/pulumi/issues/13754.
Fixes https://github.com/pulumi/pulumi/issues/13709.

This removes the install scripts that we generated as part of NodeJS and
Python packages. As we move to Python wheels we'll no longer have an way
to run these scripts (see ). That would leave NodeJS as the only
language which supports this feature.

So for consistency and simplicity just remove it from everywhere.

Users who still want to ensure plugins are installed upfront (before
`up` or similar runs) can run `pulumi plugin install` to install all the
current project plugins.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] 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.
-->
- [x] 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. -->
2023-08-30 08:05:34 +00:00
Fraser Waters 84d4cc6371 Fix isInstance methods on generated provider types in the nodejs sdks
Fixes https://github.com/pulumi/pulumi/issues/12584
2023-06-28 14:59:10 +01:00
Fraser Waters 344a300a2d Update @types/node version in tests 2023-02-07 14:20:27 +00:00
aq17 20e5b33b4b Revert "Merge #10831"
This reverts commit 184903a06f, reversing
changes made to 356d8ebf59.
2022-12-05 10:19:41 -08:00
Zaid Ajaj 10e69f3f3f Generate JS doc comments for output-versioned invokes and use explicit any type 2022-12-05 12:57:05 +01:00
Zaid Ajaj 06f98d97a2 [nodejs/sdk-gen] Simplify default options for function invokes 2022-11-14 14:58:16 +01:00
Robbie McKinstry a07a250cc1
Regen code with consistent spacing in tsconfig 2022-11-10 22:44:11 -05:00
Robbie McKinstry 59e583b611
Convert mod.utilities from a method to a function. 2022-11-10 22:37:04 -05:00
Robbie McKinstry 1d7e9ae48f
Add a special case for imports, reset codegen tests 2022-11-10 22:37:04 -05:00
Ian Wahbe 7c4bfa1b5f Add default dependencies for nodejs 2022-11-09 16:00:39 -08:00
Anton Tayanovskyy b3f31716b4 Accept codegen 2022-09-28 10:47:42 -04:00
Justin Van Patten 94fef806d2 [codegen/dotnet] Fix codegen for functions with secret parameters
The non-`Output<T>` returning functions take parameters as plain values, which cannot be made secrets. Before this change, .NET codegen was trying to convert the inputs into secrets, but this would error during compilation because the plain types are not `Input<T>`.
2022-09-23 13:47:15 -07:00