-
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
Add support for Call #263
Add support for Call #263
Conversation
What's the test plan here? |
I'm trying to determine the correct behavior before adding tests. We will definitely need tests before merging. |
ba4db4b
to
ed59ad1
Compare
Tests have been added. I think this is ready to merge. |
} | ||
}) | ||
|
||
returnDependencies[string(name)] = &rpc.CallResponse_ReturnDependencies{Urns: urns} |
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.
Is this needed even when the provider has first-class outputs in Return, where this approximation can be un-abmiguously computed? Probably no harm in including but I thought maybe engine does this?
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.
I'm not sure, but there is no documentation saying that it isn't necessary.
It seems like it is not necessary in modern Pulumi:
I'm hesitant to assume that it is never necessary.
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.
I opened pulumi/pulumi#17113 to pin down an answer here.
Nit: I would rename the PR to drop "at the provider level", looks like this introduces support for the Call gRPC method which is great. |
One important question is instance lifetime. When a client issues a series of Call methods against a resource with the same URN, is there a possibility for the provider author to rely on the retention of in-memory instance state across the series of calls? const c = new Counter()
c.increment()
c.increment()
export const n = c.curentValue /// 2 To achieve the above UX would it be possible for the implementation to be equally simple? |
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.
Code looking good but I had a few non-blocking questions. I also would suggest considering an E2E test involving the real Pulumi CLI and a sample program, at least one of those for the happy path.
Corner cases to think of (perhaps handled already in this codebase).
|
|
I believe that this is possible now, though I would discourage relying on it. AFAIK the protocol does not make any guarantees about number of provider instances, or the order of calls. In theory, both |
…ngine (#17113) This is where the engine augments `returnDependencies` with `Output` dependencies: https://github.com/pulumi/pulumi/blob/cbfea508e7b2a4f1dd0985cefbeda3a6e891f7f9/pkg/resource/deploy/source_eval.go#L1140-L1142 This is where we test that this behavior works as intended: https://github.com/pulumi/pulumi/blob/44a95c434a48a8b8153fcc419d81b5a22a961350/pkg/engine/lifecycletest/pulumi_test.go#L5041-L5042 This was motivated by pulumi/pulumi-go-provider#263 (comment).
ee5debd
to
74b2b3f
Compare
c2d0841
to
6136476
Compare
…ngine (#17113) This is where the engine augments `returnDependencies` with `Output` dependencies: https://github.com/pulumi/pulumi/blob/cbfea508e7b2a4f1dd0985cefbeda3a6e891f7f9/pkg/resource/deploy/source_eval.go#L1140-L1142 This is where we test that this behavior works as intended: https://github.com/pulumi/pulumi/blob/44a95c434a48a8b8153fcc419d81b5a22a961350/pkg/engine/lifecycletest/pulumi_test.go#L5041-L5042 This was motivated by pulumi/pulumi-go-provider#263 (comment).
…ngine (#17113) This is where the engine augments `returnDependencies` with `Output` dependencies: https://github.com/pulumi/pulumi/blob/cbfea508e7b2a4f1dd0985cefbeda3a6e891f7f9/pkg/resource/deploy/source_eval.go#L1140-L1142 This is where we test that this behavior works as intended: https://github.com/pulumi/pulumi/blob/44a95c434a48a8b8153fcc419d81b5a22a961350/pkg/engine/lifecycletest/pulumi_test.go#L5041-L5042 This was motivated by pulumi/pulumi-go-provider#263 (comment).
This PR has been shipped in release v0.22.0. |
This PR has been shipped in release v0.23.0. |
This PR adds support for the
Call
gRPC method at the top levelProvider
struct.