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
Conversation
c3c5e8c
to
f3fe7c3
Compare
@@ -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 |
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.
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 { |
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.
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 { |
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.
Woot feature flags 🎉
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@@ -235,6 +235,49 @@ func TestPluginSelection_EmptyVersionWithAlternatives(t *testing.T) { | |||
assert.Equal(t, "0.2.0", result.Version.String()) | |||
} | |||
|
|||
func TestPluginDownloadUrl(t *testing.T) { |
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'd love to see this as a table driven test
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 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
f3fe7c3
to
c7ea92a
Compare
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