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

[sdk/nodejs] Pickup provider as part of providers #8923

Merged

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Feb 3, 2022

Description

Fixes #8921

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@iwahbe iwahbe self-assigned this Feb 3, 2022
Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

sdk/nodejs/runtime/resource.ts Outdated Show resolved Hide resolved
const depreciation = "This will become an error by the end of July 2022. See https://github.com/pulumi/pulumi/issues/8799 for more details";
log.warn(message+depreciation);
} else {
(<ProviderResource[]> componentOpts.providers).push(componentOpts.provider);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is componentOpts.providers guaranteed to be truthy here? I think we need to guard against that.

Suggested change
(<ProviderResource[]> componentOpts.providers).push(componentOpts.provider);
(<ProviderResource[]> componentOpts.providers)?.push(componentOpts.provider);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do need to guard against it, but not by bailing out. In case of a providers === undefined, we should set providers = [provider]. a27708f makes that change.

@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #8923 (7e56589) into master (58cd76f) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8923   +/-   ##
=======================================
  Coverage   59.39%   59.40%           
=======================================
  Files         642      642           
  Lines       99643    99665   +22     
  Branches     1389     1392    +3     
=======================================
+ Hits        59185    59203   +18     
+ Misses      37086    37083    -3     
- Partials     3372     3379    +7     
Impacted Files Coverage Δ
sdk/nodejs/runtime/resource.ts 53.15% <0.00%> (-1.29%) ⬇️
pkg/codegen/hcl2/model/type_object.go 89.18% <0.00%> (-0.55%) ⬇️
sdk/nodejs/automation/localWorkspace.ts 74.03% <0.00%> (-0.39%) ⬇️
pkg/testing/integration/program.go 44.22% <0.00%> (-0.21%) ⬇️
sdk/python/lib/pulumi/log.py 65.78% <0.00%> (ø)
sdk/python/lib/pulumi/urn.py 20.00% <0.00%> (ø)
sdk/python/lib/pulumi/asset.py 50.00% <0.00%> (ø)
sdk/python/lib/pulumi/_types.py 31.26% <0.00%> (ø)
sdk/python/lib/pulumi/_utils.py 44.44% <0.00%> (ø)
sdk/python/lib/pulumi/config.py 44.59% <0.00%> (ø)
... and 43 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58cd76f...7e56589. Read the comment docs.

@iwahbe iwahbe merged commit b783928 into master Feb 4, 2022
@pulumi-bot pulumi-bot deleted the iwahbe/8921/ts-correctly-pickup-provider-resource-option branch February 4, 2022 11:38
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.

[sdk/nodejs] Provider specified in provider resource option not passed to engine for remote components
2 participants