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/dotnet] Check for pulumiplugin.json in package lookup #8517

Merged
merged 6 commits into from
Dec 2, 2021

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Dec 1, 2021

Description

Fixes #7244

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 Dec 1, 2021
This does not mean that I have added any tests. Just that the framework
is setup.
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #8517 (6928b6f) into master (0f19a8b) will decrease coverage by 0.16%.
The diff coverage is 78.87%.

❗ Current head 6928b6f differs from pull request most recent head 8b1cfd6. Consider uploading reports for the commit 8b1cfd6 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8517      +/-   ##
==========================================
- Coverage   58.77%   58.61%   -0.17%     
==========================================
  Files         633      634       +1     
  Lines       96388    96823     +435     
  Branches     1378     1378              
==========================================
+ Hits        56649    56749     +100     
- Misses      36477    36812     +335     
  Partials     3262     3262              
Impacted Files Coverage Δ
sdk/dotnet/cmd/pulumi-language-dotnet/main.go 16.85% <78.57%> (ø)
sdk/go/common/resource/plugin/plugin.go 66.66% <100.00%> (+7.04%) ⬆️
sdk/dotnet/Pulumi/Core/InputList.cs 33.33% <0.00%> (-19.17%) ⬇️
sdk/dotnet/Pulumi/Core/InputMap.cs 65.78% <0.00%> (-6.31%) ⬇️
sdk/dotnet/Pulumi/Extensions.cs 58.53% <0.00%> (-2.44%) ⬇️
sdk/dotnet/Pulumi/Core/Output.cs 83.87% <0.00%> (+0.67%) ⬆️
sdk/go/common/resource/plugin/host.go 52.01% <0.00%> (+1.20%) ⬆️
sdk/go/common/workspace/workspace.go 65.60% <0.00%> (+1.59%) ⬆️
sdk/go/common/workspace/paths.go 71.87% <0.00%> (+3.12%) ⬆️
... and 4 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 feef62e...8b1cfd6. Read the comment docs.

@iwahbe iwahbe requested review from justinvp and a team December 1, 2021 19:53
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

}
}

func DeterminePluginDependency(packageDir, packageName, packageVersion string) (*pulumirpc.PluginDependency, error) {

logging.V(5).Infof("GetRequiredPlugins: Determining plugin dependency: %v, %v, %v",
packageDir, packageName, packageVersion)

// Check for a `~/.nuget/packages/package_name/package_version/content/version.txt` file.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Maybe update this comment to mention pulumiplugin.json as well?

logging.V(5).Infof("GetRequiredPlugins: err: %v", err)
pulumiPlugin, err := plugin.LoadPulumiPluginJSON(pulumiPluginFilePath)
if os.IsNotExist(err) {
pulumiPlugin = nil
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary? Won't pulumiPlugin already be nil when err != nil and therefore os.IsNotExists(err) is true?

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 need the check, but not the assignment. I can fold it down to this

if err != nil && !os.IsNotExist(err) {
		return nil, err
	}

@iwahbe iwahbe merged commit a79a759 into master Dec 2, 2021
@pulumi-bot pulumi-bot deleted the iwahbe/7244/dotnet-check-for-pulumiplugin-json branch December 2, 2021 00:34
abhinav pushed a commit to pulumi/pulumi-dotnet that referenced this pull request Jan 11, 2023
…pulumi#8517)

* Check for `pulumiplugin.json` in package lookup

* Update CHANGELOG_PENDING.md

* Setup tests for dotnet/main.go

This does not mean that I have added any tests. Just that the framework
is setup.

* Add tests and fix bugs

* Fix nits
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.

.NET: Support custom server URLs for plugins
2 participants