-
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
sdk/go/StackReference: Add GetOutputDetails #12034
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Changelog[uncommitted] (2023-02-04)Features
|
036fd3e
to
454411a
Compare
403bbfa
to
8eb403b
Compare
Outputs received from StackReferences are currently unnecessarily wrapped in `Output<T>`. If the name is known (`string`, not `Input<string>`), these values are largely fixed and "known" at runtime. This change introduces a StackReference.GetOutputDetails method which returns a plain StackReferenceOutputDetails object. This object has two fields: Value and SecretValue. At most one of these fields is set, depending on whether the stack reference output is a secret. Refs #10839, #5035
8eb403b
to
18b4cae
Compare
NodeJS equivalent of the StackReference.GetOutputDetails method and accompanying type added to the Go SDK in #12034. This will allow users of the TypeScript and JavaScript SDKs to fetch outputs from stack references directly--without going through an Output type. Couple notes about testing: - `MockMonitor.readResource` kept exploding because the getCustom method was missing on the provided object. I didn't find any examples in the Node SDK of using mocks to test StackReferences, so I'm guessing this was an unexercised code path. I've fixed that. - It seems that the JavaScript SDK promotes an entire map to secret if an item inside it is a secret. So I had to isolate the two test cases into separate outputs to get the plain text case to be written as a "value". If there's a more correct way of setting up that mock, I'm happy to merge the outputs back into a single map for a more representative test case. Refs #10839, #5035
// Output value returned by the StackReference. | ||
// This field is nil if the value is a secret | ||
// or it does not exist. | ||
Value interface{} |
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.
Horrible corner case that I don't think we need to worry about, but I think an output can be "null" itself. But I imagine hardly anything in Go handles that correctly anyway.
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.
Good point. Yeah, if we get to a point where we want to support null
in the model, it might be possible to introduce a sentinel value pulumi.Null
. Although I don't think this is likely for the top-level object.
bors r+ |
Build succeeded: |
12071: sdk/py/StackReference: Add get_output_details r=abhinav a=abhinav This is the Python equivalent to the StackReference.GetOutputDetails method and accompanying type added to the Go SDK in #12034. This will allow users of the Python SDK to fetch outputs from stack references directly--without going through an Output type. Refs #10839, #5035 12072: sdk/node/StackReference: Add getOutputDetails r=abhinav a=abhinav NodeJS equivalent of the StackReference.GetOutputDetails method and accompanying type added to the Go SDK in #12034. This will allow users of the TypeScript and JavaScript SDKs to fetch outputs from stack references directly--without going through an Output type. Couple notes about testing: - `MockMonitor.readResource` kept exploding because the getCustom method was missing on the provided object. I didn't find any examples in the Node SDK of using mocks to test StackReferences, so I'm guessing this was an unexercised code path. I've fixed that. - It seems that the JavaScript SDK promotes an entire map to secret if an item inside it is a secret. So I had to isolate the two test cases into separate outputs to get the plain text case to be written as a "value". If there's a more correct way of setting up that mock, I'm happy to merge the outputs back into a single map for a more representative test case. Refs #10839, #5035 Co-authored-by: Abhinav Gupta <abhinav@pulumi.com>
12071: sdk/py/StackReference: Add get_output_details r=abhinav a=abhinav This is the Python equivalent to the StackReference.GetOutputDetails method and accompanying type added to the Go SDK in #12034. This will allow users of the Python SDK to fetch outputs from stack references directly--without going through an Output type. Refs #10839, #5035 Co-authored-by: Abhinav Gupta <abhinav@pulumi.com>
12072: sdk/node/StackReference: Add getOutputDetails r=abhinav a=abhinav NodeJS equivalent of the StackReference.GetOutputDetails method and accompanying type added to the Go SDK in #12034. This will allow users of the TypeScript and JavaScript SDKs to fetch outputs from stack references directly--without going through an Output type. Couple notes about testing: - `MockMonitor.readResource` kept exploding because the getCustom method was missing on the provided object. I didn't find any examples in the Node SDK of using mocks to test StackReferences, so I'm guessing this was an unexercised code path. I've fixed that. - It seems that the JavaScript SDK promotes an entire map to secret if an item inside it is a secret. So I had to isolate the two test cases into separate outputs to get the plain text case to be written as a "value". If there's a more correct way of setting up that mock, I'm happy to merge the outputs back into a single map for a more representative test case. Refs #10839, #5035 Co-authored-by: Abhinav Gupta <abhinav@pulumi.com>
This is the C# equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 It introduces a GetOutputDetailsAsync method that returns a StackReferenceOutputDetails promise, allowing looking at the results without going through an Output type. **Testing**: As with Node (pulumi/pulumi#12072), C# appears to promote the entire dictionary to secret if one of the values is secret. Therefore, this needed separate tests for each case. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
This is the C# equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 It introduces a GetOutputDetailsAsync method that returns a StackReferenceOutputDetails promise, allowing looking at the results without going through an Output type. **Testing**: As with Node (pulumi/pulumi#12072), C# appears to promote the entire dictionary to secret if one of the values is secret. Therefore, this needed separate tests for each case. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
Adds the Java equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 - .NET SDK in pulumi/pulumi-dotnet#103 In Java, this adds a new `StackReference.outputDetailsAsync` method which returns a CompletableFuture of a StackReferenceOutputDetails. The object has optional value and secretValue fields, at most one of which is set depending on whether the value is a secret. Neither field is set if the value is absent. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
Adds the Java equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 - .NET SDK in pulumi/pulumi-dotnet#103 In Java, this adds a new `StackReference.outputDetailsAsync` method which returns a CompletableFuture of a StackReferenceOutputDetails. The object has optional value and secretValue fields, at most one of which is set depending on whether the value is a secret. Neither field is set if the value is absent. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
Adds the Java equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 - .NET SDK in pulumi/pulumi-dotnet#103 In Java, this adds a new `StackReference.outputDetailsAsync` method which returns a CompletableFuture of a StackReferenceOutputDetails. The object has optional value and secretValue fields, at most one of which is set depending on whether the value is a secret. Neither field is set if the value is absent. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
Adds the Java equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 - .NET SDK in pulumi/pulumi-dotnet#103 In Java, this adds a new `StackReference.outputDetailsAsync` method which returns a CompletableFuture of a StackReferenceOutputDetails. The object has optional value and secretValue fields, at most one of which is set depending on whether the value is a secret. Neither field is set if the value is absent. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
Adds the Java equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 - .NET SDK in pulumi/pulumi-dotnet#103 In Java, this adds a new `StackReference.outputDetailsAsync` method which returns a CompletableFuture of a StackReferenceOutputDetails. The object has optional value and secretValue fields, at most one of which is set depending on whether the value is a secret. Neither field is set if the value is absent. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
Adds the Java equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 - .NET SDK in pulumi/pulumi-dotnet#103 In Java, this adds a new `StackReference.outputDetailsAsync` method which returns a CompletableFuture of a StackReferenceOutputDetails. The object has optional value and secretValue fields, at most one of which is set depending on whether the value is a secret. Neither field is set if the value is absent. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
Adds a blog post introducing the new StackReference OutputDetails feature. The feature was added to all supported SDKs in the following PRs: - pulumi/pulumi#12034 - pulumi/pulumi#12071 - pulumi/pulumi-dotnet#103 - pulumi/pulumi#12072 - pulumi/pulumi-java#986
Adds a blog post introducing the new StackReference OutputDetails feature. The feature was added to all supported SDKs in the following PRs: - pulumi/pulumi#12034 - pulumi/pulumi#12071 - pulumi/pulumi-dotnet#103 - pulumi/pulumi#12072 - pulumi/pulumi-java#986
Adds a blog post introducing the new StackReference OutputDetails feature. The feature was added to all supported SDKs in the following PRs: - pulumi/pulumi#12034 - pulumi/pulumi#12071 - pulumi/pulumi-dotnet#103 - pulumi/pulumi#12072 - pulumi/pulumi-java#986
Adds a blog post introducing the new StackReference OutputDetails feature. The feature was added to all supported SDKs in the following PRs: - pulumi/pulumi#12034 - pulumi/pulumi#12071 - pulumi/pulumi-dotnet#103 - pulumi/pulumi#12072 - pulumi/pulumi-java#986
This is the C# equivalent of StackReference.GetOutputDetails that was added to: - Go SDK in pulumi/pulumi#12034 - Python SDK in pulumi/pulumi#12071 - Node SDK in pulumi/pulumi#12072 It introduces a GetOutputDetailsAsync method that returns a StackReferenceOutputDetails promise, allowing looking at the results without going through an Output type. **Testing**: As with Node (pulumi/pulumi#12072), C# appears to promote the entire dictionary to secret if one of the values is secret. Therefore, this needed separate tests for each case. Refs pulumi/pulumi#10839, pulumi/pulumi#5035
Outputs received from StackReferences are currently
unnecessarily wrapped in
Output<T>
.If the name is known (
string
, notInput<string>
),these values are largely fixed and "known" at runtime.
This change introduces a
StackReference.GetOutputDetails method to Go
and a StackReference.get_output_details method to Python.
This method returns a plain OutputDetails object.
This object has two fields: value and secretValue.
At most one of these fields is set,
depending on whether the stack reference output is a secret.
Refs #10839, #5035
Related