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/dotnet] Fix codegen for functions with secret parameters #10840

Merged
merged 1 commit into from
Sep 24, 2022

Conversation

justinvp
Copy link
Member

@justinvp justinvp commented Sep 23, 2022

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 (for any input property that is marked as a secret in the schema), but this would error during compilation because the plain types are not Input<T>.

Note: Arguably, for the Output<T> returning functions, we could force any secret input properties to be secrets since they are typed as Input<T>, and similarly, force the resulting Output<T> to be a secret if any of the output properties are marked as secret. But that is something we could consider doing subsequently, as it would be a change for all languages. Tracking this in #10841.

Fixes #10838

@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2022-09-23)

Bug Fixes

  • [sdkgen/dotnet] Fixes a .NET SDK codegen bug when emitting functions with secret parameters.
    #10840

@justinvp justinvp requested review from a team, viveklak and t0yv0 September 23, 2022 19:56
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>`.
@justinvp
Copy link
Member Author

bors retry

@justinvp
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Sep 23, 2022
@justinvp
Copy link
Member Author

bors merge

@bors
Copy link
Contributor

bors bot commented Sep 23, 2022

try

Build failed:

bors bot added a commit that referenced this pull request Sep 23, 2022
10811: Add Organization to go sdk r=Frassle a=Frassle

<!--- 
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. -->

Adds organization name to the gosdk.
Part of #2800.

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] 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 Service,
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 Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


10840: [codegen/dotnet] Fix codegen for functions with secret parameters r=justinvp a=justinvp

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 (for any input property that is marked as a `secret` in the schema), but this would error during compilation because the plain types are not `Input<T>`.

Note: Arguably, for the `Output<T>` returning functions, we could force any secret input properties to be secrets since they are typed as `Input<T>`, and similarly, force the resulting `Output<T>` to be a secret if any of the output properties are marked as secret. But that is something we could consider doing subsequently, as it would be a change for all languages. Tracking this in #10841.

Fixes #10838

Co-authored-by: Fraser Waters <fraser@pulumi.com>
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
@bors
Copy link
Contributor

bors bot commented Sep 24, 2022

Build failed (retrying...):

bors bot added a commit that referenced this pull request Sep 24, 2022
10840: [codegen/dotnet] Fix codegen for functions with secret parameters r=justinvp a=justinvp

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 (for any input property that is marked as a `secret` in the schema), but this would error during compilation because the plain types are not `Input<T>`.

Note: Arguably, for the `Output<T>` returning functions, we could force any secret input properties to be secrets since they are typed as `Input<T>`, and similarly, force the resulting `Output<T>` to be a secret if any of the output properties are marked as secret. But that is something we could consider doing subsequently, as it would be a change for all languages. Tracking this in #10841.

Fixes #10838

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
@bors
Copy link
Contributor

bors bot commented Sep 24, 2022

Build failed:

@justinvp
Copy link
Member Author

bors merge

bors bot added a commit that referenced this pull request Sep 24, 2022
10840: [codegen/dotnet] Fix codegen for functions with secret parameters r=justinvp a=justinvp

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 (for any input property that is marked as a `secret` in the schema), but this would error during compilation because the plain types are not `Input<T>`.

Note: Arguably, for the `Output<T>` returning functions, we could force any secret input properties to be secrets since they are typed as `Input<T>`, and similarly, force the resulting `Output<T>` to be a secret if any of the output properties are marked as secret. But that is something we could consider doing subsequently, as it would be a change for all languages. Tracking this in #10841.

Fixes #10838

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
@bors
Copy link
Contributor

bors bot commented Sep 24, 2022

Build failed:

@justinvp
Copy link
Member Author

bors merge

@bors
Copy link
Contributor

bors bot commented Sep 24, 2022

Build succeeded:

@bors bors bot merged commit 255495e into master Sep 24, 2022
@bors bors bot deleted the justin/funcsecrets branch September 24, 2022 04:41
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.

[codegen/dotnet] Generated code for functions with secret parameters fails to compile
3 participants