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

[CLI] Allow downloading plugins from GitHub Releases #8785

Merged
merged 1 commit into from Jan 20, 2022

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Jan 19, 2022

Rather than downloading from get.pulumi.com, we now have changed to
specify that providers are downloaded from GitHub Releases for
all of the official plugins

Description

Fixes # (issue)

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

@stack72 stack72 requested a review from a team January 19, 2022 20:36
@stack72 stack72 force-pushed the download-from-ghr branch 2 times, most recently from c3c5e8c to f3fe7c3 Compare January 19, 2022 20:43
@@ -219,10 +219,10 @@ func interpolateURL(serverURL string, version semver.Version, os, arch string) s
// Download fetches an io.ReadCloser for this plugin and also returns the size of the response (if known).
func (info PluginInfo) Download() (io.ReadCloser, int64, error) {
// Figure out the OS/ARCH pair for the download URL.
var os string
var opSy string
Copy link
Member

Choose a reason for hiding this comment

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

It took me so long to work out this is "op_erating_Sy_stem" 😖

kind, name, version.String(), opSy, arch)))
}

func buildPulumiHostedPluginURL(kind PluginKind, name string, version *semver.Version, opSy, arch string) string {
Copy link
Member

Choose a reason for hiding this comment

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

This method is just buildUserSpecifiedPluginURL("https://get.pulumi.com/releases/plugins", kind, name, version, opSy, arch)

}
serverURL = interpolateURL(serverURL, *info.Version, os, arch)

if _, ok := os.LookupEnv("PULUMI_EXPERIMENTAL"); ok {
Copy link
Member

Choose a reason for hiding this comment

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

Woot feature flags 🎉

@codecov
Copy link

codecov bot commented Jan 19, 2022

Codecov Report

Merging #8785 (c7ea92a) into master (4886c2a) will increase coverage by 0.03%.
The diff coverage is 76.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8785      +/-   ##
==========================================
+ Coverage   59.35%   59.39%   +0.03%     
==========================================
  Files         637      637              
  Lines       97765    97911     +146     
  Branches     1385     1386       +1     
==========================================
+ Hits        58031    58153     +122     
- Misses      36461    36477      +16     
- Partials     3273     3281       +8     
Impacted Files Coverage Δ
sdk/go/common/workspace/plugins.go 56.60% <76.08%> (+0.32%) ⬆️
...k/dotnet/Pulumi/Deployment/TaskMonitoringHelper.cs 96.29% <0.00%> (-3.71%) ⬇️
sdk/nodejs/automation/localWorkspace.ts 74.03% <0.00%> (-0.39%) ⬇️
sdk/proto/go/provider.pb.go 34.26% <0.00%> (-0.12%) ⬇️
pkg/resource/deploy/step_generator.go 84.06% <0.00%> (-0.04%) ⬇️
sdk/nodejs/proto/provider_pb.js 26.34% <0.00%> (-0.03%) ⬇️
sdk/go/common/resource/resource_state.go 100.00% <0.00%> (ø)
...dk/python/lib/pulumi/runtime/proto/provider_pb2.py 100.00% <0.00%> (ø)
sdk/go/common/resource/plugin/provider_plugin.go 58.43% <0.00%> (+0.03%) ⬆️
... and 7 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 4886c2a...c7ea92a. Read the comment docs.

@@ -235,6 +235,49 @@ func TestPluginSelection_EmptyVersionWithAlternatives(t *testing.T) {
assert.Equal(t, "0.2.0", result.Version.String())
}

func TestPluginDownloadUrl(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd love to see this as a table driven test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will be looping back to this code once we make it the default so I will fix these up then just incase it needs to change

Rather than downloading from get.pulumi.com, we now have changed to
specify that providers are downloaded from GitHub Releases for
all of the official plugins
@stack72 stack72 merged commit a14cd1c into master Jan 20, 2022
@stack72 stack72 deleted the download-from-ghr branch January 20, 2022 15:50
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.

None yet

3 participants