Conversation
| TeamName string `json:"team_name"` | ||
| AddonName string `json:"addon_name"` | ||
| // AddonType string `json:"addon_type"` // unused | ||
| // AddonFormat string `json:"addon_format"` // unused |
There was a problem hiding this comment.
These fields belong to the addon entry and not addon_version, so there's no use for them here. We could try to GET the addon and compare/verify the values if we really want to make sure.
There was a problem hiding this comment.
Seems fine, though I would probably still read the properties, but just not use them
cli/cmd/addon_publish.go
Outdated
| name := fmt.Sprintf("%s/%s@%s", manifest.TeamName, manifest.AddonName, version) | ||
| fmt.Printf("Publishing %s to CloudQuery Hub...\n", name) | ||
|
|
||
| c, err := cloudquery_api.NewClientWithResponses(getEnvOrDefault("CLOUDQUERY_API_URL", defaultAPIURL), |
There was a problem hiding this comment.
Let's create a constant in constants.go for CLOUDQUERY_API_URL, since it's used in multiple places now
| manifest.PluginDeps = []string{} | ||
| } | ||
| if manifest.AddonDeps == nil { | ||
| manifest.AddonDeps = []string{} |
There was a problem hiding this comment.
Otherwise we get:
Error: failed to create new draft version: 400: request body has an error: doesn't match schema: Error at "/addon_deps": Value is not nullable
|
|
||
| func createNewAddonDraftVersion(ctx context.Context, c *cloudquery_api.ClientWithResponses, manifest ManifestJSONV1, version, manifestDir, zipPath string) error { | ||
| if manifest.PluginDeps == nil { | ||
| manifest.PluginDeps = []string{} |
There was a problem hiding this comment.
This shouldn't happen, but it's better to get a better error if the plugin_deps is empty, something like:
Error: failed to create new draft version: 400: request body has an error: doesn't match schema: Error at "/plugin_deps": minimum number of items is 1
Rather than:
Error: failed to create new draft version: 400: request body has an error: doesn't match schema: Error at "/plugin_deps": Value is not nullable
| mkdir -p ~/.local/share/cloudquery | ||
| echo ${{ secrets.CQ_CI_CLOUDQUERY_HUB_TOKEN }} > ~/.local/share/cloudquery/token | ||
| cloudquery publish cloudquery/${{ needs.prepare.outputs.plugin_name }} --finalize | ||
| cloudquery plugin publish cloudquery/${{ needs.prepare.outputs.plugin_name }} --finalize |
There was a problem hiding this comment.
For this to work we actually need to release a new CLI version and update it in the workflow here
There was a problem hiding this comment.
See https://github.com/cloudquery/cloudquery/actions/runs/6562442141/job/17824393847#step:11:7.
I'll release #14659 and renovate should handle the update for us
🤖 I have created a release *beep* *boop* --- ## [3.25.0](cli-v3.24.0...cli-v3.25.0) (2023-10-18) ### Features * Addon CLI ([#14564](#14564)) ([33e7833](33e7833)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.15.2 ([#14662](#14662)) ([e274fe4](e274fe4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Co-authored-by: Kemal Hadimli <disq@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [3.25.0](cloudquery/cloudquery@cli-v3.24.0...cli-v3.25.0) (2023-10-18) ### Features * Addon CLI ([cloudquery#14564](cloudquery#14564)) ([33e7833](cloudquery@33e7833)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.15.2 ([cloudquery#14662](cloudquery#14662)) ([e274fe4](cloudquery@e274fe4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Implements https://github.com/cloudquery/cloudquery-issues/issues/600
cloudquery installis nowcloudquery plugin install(cloudquery installstill works...)cloudquery publish=>cloudquery plugin publishnew command:
cloudquery addon publish