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/nodejs] Fix regression when passing a provider to a MLC #11509
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changelog[uncommitted] (2022-12-02)Bug Fixes
|
iwahbe
approved these changes
Dec 2, 2022
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.
Instead of reverting the whole PR, let's just revert the part that causes the problem.
justinvp
force-pushed
the
justin/compprovider
branch
from
December 2, 2022 01:00
7dfa98d
to
63f65ee
Compare
#11093 changed the Node.js SDK to pass a provider specified in a MLC's `ResourceOptions.provider` to the engine. Unfortunately, this regresses behavior that existing programs rely on. For example: ```ts import * as aws from "@pulumi/aws"; import * as awsx from "@pulumi/awsx"; const myRegion = new aws.Provider("us-east-1", { region: "us-east-1", }); const vpc = new awsx.ec2.Vpc("awsx-nodejs-default-args", {}, { provider: myRegion }); ``` In the above program, an explicit _aws_ provider is being passed to the _awsx_ `VPC` component, with the intention that the _aws_ provider will be used as the provider for all of `Vpc`'s children. With the change in #11093, the engine would try to call `Construct` for the `Vpc` using the specified `aws` provider, which does not work (it fails with `plugins that can construct components must support secrets`). This change reverts the change from #11093 that included the `provider` in the `RegisterResourceRequest` for MLCs, and adds a regression test to lock-in the previous behavior. Note: We do want to be able to support specifying a MLC's provider (to allow explicit providers for MLCs), but we'll address that in a separate change.
justinvp
force-pushed
the
justin/compprovider
branch
from
December 2, 2022 17:54
63f65ee
to
8259c2b
Compare
bors merge |
bors bot
added a commit
that referenced
this pull request
Dec 2, 2022
11509: [sdk/nodejs] Fix regression when passing a provider to a MLC r=justinvp a=justinvp #11093 changed the Node.js SDK to pass a provider specified in a MLC's `ResourceOptions.provider` to the engine. Unfortunately, this regresses behavior that existing programs rely on. For example: ```ts import * as aws from "`@pulumi/aws";` import * as awsx from "`@pulumi/awsx";` const myRegion = new aws.Provider("us-east-1", { region: "us-east-1", }); const vpc = new awsx.ec2.Vpc("awsx-nodejs-default-args", {}, { provider: myRegion }); ``` In the above program, an explicit _aws_ provider is being passed to the _aws**x**_ `VPC` component, with the intention that the _aws_ provider will be used as the provider for all of `Vpc`'s children. With the change in #11093, the engine would try to call `Construct` for the `Vpc` using the specified `aws` provider, which does not work (it fails with `plugins that can construct components must support secrets`). This change reverts the problematic change from #11093 and adds a regression test to lock-in the previous behavior. Note: We do want to be able to support specifying a MLC's provider (to allow explicit providers for MLCs), but we'll address that in a separate change. (I'll open an issue). Fixes #11316 Co-authored-by: Justin Van Patten <jvp@justinvp.com>
Build failed: |
bors retry |
bors bot
added a commit
that referenced
this pull request
Dec 2, 2022
11509: [sdk/nodejs] Fix regression when passing a provider to a MLC r=justinvp a=justinvp #11093 changed the Node.js SDK to pass a provider specified in a MLC's `ResourceOptions.provider` to the engine. Unfortunately, this regresses behavior that existing programs rely on. For example: ```ts import * as aws from "`@pulumi/aws";` import * as awsx from "`@pulumi/awsx";` const myRegion = new aws.Provider("us-east-1", { region: "us-east-1", }); const vpc = new awsx.ec2.Vpc("awsx-nodejs-default-args", {}, { provider: myRegion }); ``` In the above program, an explicit _aws_ provider is being passed to the _aws**x**_ `VPC` component, with the intention that the _aws_ provider will be used as the provider for all of `Vpc`'s children. With the change in #11093, the engine would try to call `Construct` for the `Vpc` using the specified `aws` provider, which does not work (it fails with `plugins that can construct components must support secrets`). This change reverts the problematic change from #11093 and adds a regression test to lock-in the previous behavior. Note: We do want to be able to support specifying a MLC's provider (to allow explicit providers for MLCs), but we'll address that in a separate change. (I'll open an issue). Fixes #11316 Co-authored-by: Justin Van Patten <jvp@justinvp.com>
Build failed: |
bors retry |
Build succeeded: |
This was referenced Jun 26, 2023
Unable to deploy component resource with
disable-default-providers: ["*"]
in TS after v3.43.1
#13074
Closed
bors bot
added a commit
that referenced
this pull request
Jul 13, 2023
13282: [sdk/nodejs,python] Add support for explicit providers for packaged components r=justinvp a=justinvp Add support for explicit providers for packaged components in the Node.js and Python SDKs. Go already supports it. Node.js briefly supported it with #11093, but the change was reverted in #11509 due to an issue. Python has never supported it. The PR is broken up into multiple commits for easier reviewing. Fixes #13074 Part of #11520 Co-authored-by: Justin Van Patten <jvp@justinvp.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#11093 changed the Node.js SDK to pass a provider specified in a MLC's
ResourceOptions.provider
to the engine.Unfortunately, this regresses behavior that existing programs rely on. For example:
In the above program, an explicit aws provider is being passed to the awsx
VPC
component, with the intention that the aws provider will be used as the provider for all ofVpc
's children.With the change in #11093, the engine would try to call
Construct
for theVpc
using the specifiedaws
provider, which does not work (it fails withplugins that can construct components must support secrets
).This change reverts the problematic change from #11093 and adds a regression test to lock-in the previous behavior.
Note: We do want to be able to support specifying a MLC's provider (to allow explicit providers for MLCs), but we'll address that in a separate change. (Tracked by #11520).
Fixes #11316