Skip to content

fix: Resolve plugin version from GitHub registry instead of gRPC call#1856

Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/use_version_from_github
Sep 18, 2022
Merged

fix: Resolve plugin version from GitHub registry instead of gRPC call#1856
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/use_version_from_github

Conversation

@erezrokah
Copy link
Copy Markdown
Member

@erezrokah erezrokah commented Sep 18, 2022

Summary

This PR fixes https://github.com/cloudquery/docs/issues/216 which is still present in v2 and causing failures in #1848. Also somehow related to #908

If you try:

  1. gen source test
  2. gen destination postgresql
  3. gen sync .
    you'll get the follow error:
Loading specs from directory:  .
Downloading plugin from: https://github.com/cloudquery/cloudquery/releases/download/plugins/source/test/development/test_darwin_arm64.zip to: .cq/plugins/github/cloudquery/test/development/cq-source-test_darwin_arm64.zip 
Error: failed to sync source test: failed to get source plugin client for test: failed to download plugin: bad status: 404 Not Found. downloading https://github.com/cloudquery/cloudquery/releases/download/plugins/source/test/development/test_darwin_arm64.zip
exit status 1

This is because the test plugin doesn't embed the version correctly when released (and probably others too), thus reports a development version which is embedded in the config:

kind: "source"
spec:
  # Name of the plugin.
  name: "test"

  # Version of the plugin to use.
  version: "development"
...

Then the CLI tries to download that version from GitHub and fails.
Since we already know the version from GitHub I suggest we use that one instead of the gRPC call. For local/gRPC plugins the version is not important (at the moment).
The version is already set in

spec.Version, err = p.versionsClient.GetLatestPluginRelease(ctx, org, "source", repo)
so I only needed to pass in a pointer


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Test locally on your own infrastructure
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@erezrokah erezrokah force-pushed the fix/use_version_from_github branch from badc502 to 940ef25 Compare September 18, 2022 15:34
@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Sep 18, 2022
@kodiakhq kodiakhq bot merged commit 14d2ca6 into cloudquery:main Sep 18, 2022
kodiakhq bot pushed a commit that referenced this pull request Sep 21, 2022
🤖 I have created a release *beep* *boop*
---


## [0.33.0-pre.0](cli-v0.32.12-pre.0...cli/v0.33.0-pre.0) (2022-09-21)


### ⚠ BREAKING CHANGES

* CloudQuery V2. (#1463)

### Features

* CloudQuery V2. ([#1463](#1463)) ([d1799f3](d1799f3))
* Create directory structure when generating configuration ([#1845](#1845)) ([4f9c8de](4f9c8de))
* **gcp:** Remove Classify and IgnoreError ([#1757](#1757)) ([3d34ca5](3d34ca5))
* Generate `postgresql` as default destination in `gen` command ([#1863](#1863)) ([aad6218](aad6218))
* Generate auto-filled config ([#1764](#1764)) ([2255404](2255404))
* **sync:** Default input directory to '.' ([#1869](#1869)) ([005c915](005c915))
* Use jsonb for json columns ([#1870](#1870)) ([78e37fc](78e37fc))
* Use spinner instead of progress bar ([#1829](#1829)) ([af9129e](af9129e))


### Bug Fixes

* Checksum validation ([#1637](#1637)) ([a899cce](a899cce))
* CLI dev version ([#1864](#1864)) ([9c18606](9c18606))
* **cli-docs:** Fix typos in docs/index ([#1256](#1256)) ([424da6d](424da6d))
* **cli:** Don't pre-pend cq-provider to monorepo binary name ([#1264](#1264)) ([2b1e082](2b1e082))
* **cli:** Fix cli version checking to work with monorepo ([#1510](#1510)) ([e0ddfcf](e0ddfcf))
* **cli:** Keep old entrypoint name ([#1297](#1297)) ([bab4f39](bab4f39))
* **cli:** Update binary name ([#1304](#1304)) ([432c404](432c404))
* **deps:** Update github.com/hairyhenderson/go-fsimpl digest to dc4ac0a ([#1650](#1650)) ([9222b5a](9222b5a))
* **deps:** Update github.com/ProtonMail/go-crypto digest to 4b6e5c5 ([#1649](#1649)) ([c71d859](c71d859))
* **deps:** Update module github.com/cloudquery/cq-provider-sdk to v0.14.7 ([#1272](#1272)) ([8546173](8546173))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.1.2 ([#1750](#1750)) ([fbe1b78](fbe1b78))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.4 ([#1761](#1761)) ([7a83a65](7a83a65))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.5 ([#1769](#1769)) ([c9c8c05](c9c8c05))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.6 ([#1770](#1770)) ([5bc205e](5bc205e))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.7 ([#1783](#1783)) ([c291499](c291499))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.8 ([#1784](#1784)) ([b64e2d1](b64e2d1))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.9 ([#1785](#1785)) ([c6e8cb0](c6e8cb0))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.4.0 ([#1786](#1786)) ([cba274b](cba274b))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.4.1 ([#1787](#1787)) ([bad385c](bad385c))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.4.2 ([#1789](#1789)) ([79a46a2](79a46a2))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.5.0 ([#1792](#1792)) ([0b4834e](0b4834e))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.5.2 ([#1793](#1793)) ([36fd6a1](36fd6a1))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.0 ([#1817](#1817)) ([bd68a9c](bd68a9c))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.1 ([#1820](#1820)) ([2613e23](2613e23))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.2 ([#1838](#1838)) ([5b16c59](5b16c59))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.3 ([#1858](#1858)) ([9e3ace7](9e3ace7))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.4 ([#1862](#1862)) ([5d141cf](5d141cf))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.1 ([#1865](#1865)) ([474bb70](474bb70))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.2 ([#1872](#1872)) ([49ed26d](49ed26d))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.3 ([#1886](#1886)) ([7435d59](7435d59))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.4 ([#1889](#1889)) ([63a5362](63a5362))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.9 ([#1891](#1891)) ([3469f20](3469f20))
* **deps:** Update module github.com/hashicorp/go-plugin to v1.4.5 ([#1665](#1665)) ([6107aef](6107aef))
* **deps:** Update module github.com/mattn/go-isatty to v0.0.16 ([#1666](#1666)) ([44f0998](44f0998))
* Quote kind string in generated yml files ([#1824](#1824)) ([6c184ce](6c184ce))
* **release:** Embed correct modules version ([#1849](#1849)) ([2095a3b](2095a3b))
* Remove deprecated firebase ([#1568](#1568)) ([a879709](a879709))
* Resolve plugin version from GitHub registry instead of gRPC call ([#1856](#1856)) ([14d2ca6](14d2ca6))
* Use correct binary path on Windows ([#1894](#1894)) ([1ee41e7](1ee41e7))
* Use postgres defaults in destination config ([#1846](#1846)) ([24bbbc1](24bbbc1))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
yevgenypats added a commit that referenced this pull request Sep 26, 2022
🤖 I have created a release *beep* *boop*
---


##
[1.1.0-pre.1](cli-v1.1.0-pre.0...cli-v1.1.0-pre.1)
(2022-09-26)


### ⚠ BREAKING CHANGES

* **cli:** Remove gen command (#2022)
* CloudQuery V1. (#1463)

### Features

* **cli:** Disable sentry in development
([#1939](#1939))
([e2c417e](e2c417e))
* **cli:** Remove gen command
([#2022](#2022))
([83a32dd](83a32dd))
* CloudQuery V2.
([#1463](#1463))
([d1799f3](d1799f3))
* Create directory structure when generating configuration
([#1845](#1845))
([4f9c8de](4f9c8de))
* **gcp:** Remove Classify and IgnoreError
([#1757](#1757))
([3d34ca5](3d34ca5))
* Generate `postgresql` as default destination in `gen` command
([#1863](#1863))
([aad6218](aad6218))
* Generate auto-filled config
([#1764](#1764))
([2255404](2255404))
* Move to standalone postgresql plugin
([#2074](#2074))
([a0de6d3](a0de6d3))
* **sync:** Default input directory to '.'
([#1869](#1869))
([005c915](005c915))
* Use jsonb for json columns
([#1870](#1870))
([78e37fc](78e37fc))
* Use new tag format to download plugins
([#1985](#1985))
([583f54e](583f54e))
* Use spinner instead of progress bar
([#1829](#1829))
([af9129e](af9129e))


### Bug Fixes

* Can't gen with specific version
([#1915](#1915))
([b7ae169](b7ae169))
* Checksum validation
([#1637](#1637))
([a899cce](a899cce))
* CLI dev version
([#1864](#1864))
([9c18606](9c18606))
* **cli:** Fix cli version checking to work with monorepo
([#1510](#1510))
([e0ddfcf](e0ddfcf))
* **cli:** Remove debug output printed to stdout
([#1929](#1929))
([eec9627](eec9627))
* **deps:** Update github.com/hairyhenderson/go-fsimpl digest to dc4ac0a
([#1650](#1650))
([9222b5a](9222b5a))
* **deps:** Update github.com/ProtonMail/go-crypto digest to 4b6e5c5
([#1649](#1649))
([c71d859](c71d859))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.1.2
([#1750](#1750))
([fbe1b78](fbe1b78))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.4
([#1761](#1761))
([7a83a65](7a83a65))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.5
([#1769](#1769))
([c9c8c05](c9c8c05))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.6
([#1770](#1770))
([5bc205e](5bc205e))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.7
([#1783](#1783))
([c291499](c291499))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.8
([#1784](#1784))
([b64e2d1](b64e2d1))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.2.9
([#1785](#1785))
([c6e8cb0](c6e8cb0))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.4.0
([#1786](#1786))
([cba274b](cba274b))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.4.1
([#1787](#1787))
([bad385c](bad385c))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.4.2
([#1789](#1789))
([79a46a2](79a46a2))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.5.0
([#1792](#1792))
([0b4834e](0b4834e))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.5.2
([#1793](#1793))
([36fd6a1](36fd6a1))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.0
([#1817](#1817))
([bd68a9c](bd68a9c))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.1
([#1820](#1820))
([2613e23](2613e23))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.2
([#1838](#1838))
([5b16c59](5b16c59))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.3
([#1858](#1858))
([9e3ace7](9e3ace7))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.6.4
([#1862](#1862))
([5d141cf](5d141cf))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.1
([#1865](#1865))
([474bb70](474bb70))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.12
([#1916](#1916))
([27d8153](27d8153))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.2
([#1872](#1872))
([49ed26d](49ed26d))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.3
([#1886](#1886))
([7435d59](7435d59))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.4
([#1889](#1889))
([63a5362](63a5362))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.9
([#1891](#1891))
([3469f20](3469f20))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.8.0
([#1997](#1997))
([4fa40da](4fa40da))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.8.1
([#2024](#2024))
([8f88de4](8f88de4))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.8.2
([#2044](#2044))
([9b69b46](9b69b46))
* **deps:** Update module github.com/hashicorp/go-plugin to v1.4.5
([#1665](#1665))
([6107aef](6107aef))
* **deps:** Update module github.com/mattn/go-isatty to v0.0.16
([#1666](#1666))
([44f0998](44f0998))
* Don't print skip download message to console
([#2008](#2008))
([a947d44](a947d44))
* **pg:** Fix PKs recreation when nothing changed
([#1938](#1938))
([5db7baa](5db7baa))
* Quote kind string in generated yml files
([#1824](#1824))
([6c184ce](6c184ce))
* **release:** Embed correct modules version
([#1849](#1849))
([2095a3b](2095a3b))
* Remove deprecated firebase
([#1568](#1568))
([a879709](a879709))
* Resolve plugin version from GitHub registry instead of gRPC call
([#1856](#1856))
([14d2ca6](14d2ca6))
* Use correct binary path on Windows
([#1894](#1894))
([1ee41e7](1ee41e7))
* Use postgres defaults in destination config
([#1846](#1846))
([24bbbc1](24bbbc1))
* Use uppercase downloading during progress
([#2006](#2006))
([e6a7a44](e6a7a44))

---
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: Yevgeny Pats <16490766+yevgenypats@users.noreply.github.com>
@erezrokah erezrokah deleted the fix/use_version_from_github branch December 15, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants