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

fix: Better addon downloads #15173

Merged
merged 13 commits into from
Nov 15, 2023
Merged

fix: Better addon downloads #15173

merged 13 commits into from
Nov 15, 2023

Conversation

disq
Copy link
Member

@disq disq commented Nov 7, 2023

Get addon downloads to work without making 2 extra api requests but still verifying checksum.
Needs https://github.com/cloudquery/cloud/pull/660 to be solved/merged first (internal issue)

Also updates plugin-pb-go to verify the plugin downloads from the hub (PR)

We might keep this out and use the AddonWithTeam endpoint which is going to be implemented in the backend soon.

@cq-bot cq-bot added the area/cli label Nov 7, 2023
cli/cmd/addon_download.go Outdated Show resolved Hide resolved
)

switch targetDir {
case "-":
fileWriter = os.Stdout
default:
zipPath := filepath.Join(targetDir, addonFilename(teamName, addonType, addonName, version, format))
zipPath := filepath.Join(targetDir, path.Base(res.Request.URL.Path))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we infer the filename from the final URL.

@disq disq marked this pull request as ready for review November 13, 2023 10:37
cli/go.mod Outdated Show resolved Hide resolved
cli/go.mod Outdated Show resolved Hide resolved
@@ -6,7 +6,7 @@ require (
github.com/apache/arrow/go/v14 v14.0.0-20231031200323-c49e24273160
github.com/bradleyjkemp/cupaloy/v2 v2.8.0
github.com/cenkalti/backoff/v4 v4.2.1
github.com/cloudquery/cloudquery-api-go v1.4.6
github.com/cloudquery/cloudquery-api-go v1.5.1
Copy link
Member Author

@disq disq Nov 15, 2023

Choose a reason for hiding this comment

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

We now use 1.5.x to infer if we need to use the /teams/* endpoint or not, depending on token type.

@disq disq requested a review from erezrokah November 15, 2023 12:36
@disq disq added the automerge Automatically merge once required checks pass label Nov 15, 2023
@kodiakhq kodiakhq bot merged commit 958483f into main Nov 15, 2023
12 checks passed
@kodiakhq kodiakhq bot deleted the fix/addon-download-better branch November 15, 2023 13:32
kodiakhq bot pushed a commit that referenced this pull request Nov 15, 2023
🤖 I have created a release *beep* *boop*
---


## [3.29.0](cli-v3.28.1...cli-v3.29.0) (2023-11-15)


### Features

* Add `plugin docs` commands for doc updates ([#15264](#15264)) ([307d7bd](307d7bd))
* Add teamName to managed plugin configuration ([#15278](#15278)) ([b3cf9b8](b3cf9b8))


### Bug Fixes

* Better addon downloads ([#15173](#15173)) ([958483f](958483f))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.18.0 ([#15132](#15132)) ([81ee138](81ee138))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.18.1 ([#15263](#15263)) ([a9a39ef](a9a39ef))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli automerge Automatically merge once required checks pass
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants