From a1911d6b1696adf39b451595ea4398cb4a0f6fc4 Mon Sep 17 00:00:00 2001 From: Puskar Basu Date: Tue, 29 Oct 2024 13:22:39 +0530 Subject: [PATCH 01/10] Updated README.md to include instructions to build FDW --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 1dbaad82..ed196aaf 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,36 @@ Suppose you want to build the FDW for a plugin with an alias `aws` from a GitHub $ make standalone plugin="aws" ``` +#### To build a local plugin or an external plugin(not maintained by Turbot) + +Suppose you want to build the FDW for your own plugin(not maintained by Turbot) located at https://github.com/francois2metz/steampipe-plugin-scalingo. You would need to build the FDW by running the following command: +``` +$ make standalone plugin="scalingo" plugin_github_url="github.com/francois2metz/steampipe-plugin-scalingo" +``` + +#### Installing the built standalone FDW + +Once you have built the standalone FDW, the binaries will be available in a folder `build-Darwin` or `build-Linux` depending on your OS. Run the `install.sh` script available in that directory. This will detect the installed PostrgeSQL version and location and copy the binaries there. + +``` +➜ steampipe-postgres-fdw ✗ cd build-Darwin +➜ build-Darwin ✗ ./install.sh + +Discovered: +- PostgreSQL version: 14 +- PostgreSQL location: /opt/homebrew/Cellar/postgresql@14/14.13_1 + +Install Steampipe PostgreSQL FDW for version 14 in /opt/homebrew/Cellar/postgresql@14/14.13_1? (Y/n): + +Installing... + +Successfully installed steampipe_postgres_scalingo extension! + +Files have been copied to: +- Library directory: /opt/homebrew/lib/postgresql@14 +- Extension directory: /opt/homebrew/share/postgresql@14/extension/ +``` + ## Open Source & Contributing This repository is published under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license. Please see our [code of conduct](https://github.com/turbot/.github/blob/main/CODE_OF_CONDUCT.md). We look forward to collaborating with you! From ce18dd1a8e1ed425f1f9a1b58d2c57ba704b995f Mon Sep 17 00:00:00 2001 From: Puskar Basu Date: Mon, 3 Feb 2025 17:41:05 +0530 Subject: [PATCH 02/10] Use ubuntu-22.04 runner --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c7e7ca93..1e0eee63 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ env: jobs: publish: name: Publish - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Get Release assets env: From 4181cc01e6cb628d6aebb7ab25a1185cbd6abe20 Mon Sep 17 00:00:00 2001 From: Puskar Basu Date: Wed, 5 Feb 2025 17:47:03 +0530 Subject: [PATCH 03/10] Upgrade pipe-fittings to v1.6.8 and steampipe-plugin-sdk to v5.11.2 --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 1744dfab..ce9dc536 100644 --- a/go.mod +++ b/go.mod @@ -9,14 +9,14 @@ require ( github.com/hashicorp/go-version v1.7.0 // indirect github.com/turbot/go-kit v0.10.0-rc.0 github.com/turbot/steampipe v1.0.2 - github.com/turbot/steampipe-plugin-sdk/v5 v5.11.0 + github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2 go.opentelemetry.io/otel v1.26.0 google.golang.org/protobuf v1.34.2 ) require ( github.com/Masterminds/semver/v3 v3.2.1 - github.com/turbot/pipe-fittings v1.6.0 + github.com/turbot/pipe-fittings v1.6.8 go.opentelemetry.io/otel/metric v1.26.0 ) @@ -84,7 +84,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/thediveo/enumflag/v2 v2.0.5 // indirect - github.com/turbot/pipes-sdk-go v0.9.1 // indirect + github.com/turbot/pipes-sdk-go v0.12.0 // indirect github.com/turbot/steampipe-plugin-code v0.7.0 // indirect github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7 // indirect github.com/ulikunitz/xz v0.5.10 // indirect diff --git a/go.sum b/go.sum index c6bbad26..e1f8af50 100644 --- a/go.sum +++ b/go.sum @@ -755,16 +755,16 @@ github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQ github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4= github.com/turbot/go-kit v0.10.0-rc.0 h1:kd+jp2ibbIV33Hc8SsMAN410Dl9Pz6SJ40axbKUlSoA= github.com/turbot/go-kit v0.10.0-rc.0/go.mod h1:fFQqR59I5z5JeeBLfK1PjSifn4Oprs3NiQx0CxeSJxs= -github.com/turbot/pipe-fittings v1.6.0 h1:sn4OJPQQR0fggKMNUuyvShJipZG/Ze5jR48Hl12Eokg= -github.com/turbot/pipe-fittings v1.6.0/go.mod h1:1nlRVh18QkYy9eq5pW9gpnoE2VgnQW0Y2zKzrH8Q4kI= -github.com/turbot/pipes-sdk-go v0.9.1 h1:2yRojY2wymvJn6NQyE6A0EDFV267MNe+yDLxPVvsBwM= -github.com/turbot/pipes-sdk-go v0.9.1/go.mod h1:Mb+KhvqqEdRbz/6TSZc2QWDrMa5BN3E4Xw+gPt2TRkc= +github.com/turbot/pipe-fittings v1.6.8 h1:cIzFQdHU081IyyWff9R3ieR9fzIxdB3kiSZxwl1K6oc= +github.com/turbot/pipe-fittings v1.6.8/go.mod h1:CYlcJEGHs39ZSHJm1iHXtQSSaUApJZMQ5M7XeZj8pEc= +github.com/turbot/pipes-sdk-go v0.12.0 h1:esbbR7bALa5L8n/hqroMPaQSSo3gNM/4X0iTmHa3D6U= +github.com/turbot/pipes-sdk-go v0.12.0/go.mod h1:Mb+KhvqqEdRbz/6TSZc2QWDrMa5BN3E4Xw+gPt2TRkc= github.com/turbot/steampipe v1.0.2 h1:DDOyobm4lk6GLWmfwNtjB47YEbkoDmGMOlXvmTWDVsU= github.com/turbot/steampipe v1.0.2/go.mod h1:MmQAJWZXBzGczTukxRaflQC93zpYaVvm8GZfpJsE7u4= github.com/turbot/steampipe-plugin-code v0.7.0 h1:SROYIo/TI/Q/YNfXK+sAIS71umypUFm1Uz851TmoJkM= github.com/turbot/steampipe-plugin-code v0.7.0/go.mod h1:GvdjncWum4sZNmR0iM03SKkIzl7aZKAFtIsyAR+z4YI= -github.com/turbot/steampipe-plugin-sdk/v5 v5.11.0 h1:/X81yp9eLp4qhkXTbbYgxASvMViWUc49LHEoH93LZqo= -github.com/turbot/steampipe-plugin-sdk/v5 v5.11.0/go.mod h1:xXCv6EDYQSKBTblEDra3nI9ZuVBnaeVJzsNTQzFngFI= +github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2 h1:oOOM5lk1RGnXUKYYAhsxcK45TcTuKUeE+r8lA3UYJAQ= +github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2/go.mod h1:JJVjTmepkwUSC7BgXyyYCvtmhuLXAEathl737Qs4Mls= github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7 h1:qDMxFVd8Zo0rIhnEBdCIbR+T6WgjwkxpFZMN8zZmmjg= github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7/go.mod h1:5hzpfalEjfcJWp9yq75/EZoEu2Mzm34eJAPm3HOW2tw= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= From 060e706ab2549fc1e3d45c96c6d06a97f36468ea Mon Sep 17 00:00:00 2001 From: Puskar Basu Date: Wed, 5 Feb 2025 17:49:09 +0530 Subject: [PATCH 04/10] v1.12.3 --- CHANGELOG.md | 4 ++++ version/version.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed91691d..285488ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.12.3 [2024-02-05] +_Dependencies_ +- Upgrade `pipe-fittings` to v1.6.8 and `steampipe-plugin-sdk` to v5.11.2. + ## v1.12.2 [2024-02-03] _Dependencies_ - Upgrade `crypto`, `net` and `go-git` packages to remediate critical and high vulnerabilities. diff --git a/version/version.go b/version/version.go index 00096995..4a9d0d05 100644 --- a/version/version.go +++ b/version/version.go @@ -11,7 +11,7 @@ import ( ) // The main version number that is being run at the moment. -var fdwVersion = "1.12.2" +var fdwVersion = "1.12.3" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release From 0b58af228b7c30403d0960f64878059ed138569b Mon Sep 17 00:00:00 2001 From: Puskar Basu <45908484+pskrbasu@users.noreply.github.com> Date: Wed, 12 Feb 2025 00:20:20 +0530 Subject: [PATCH 05/10] Upgrade pipe-fittings to v2; go-kit to v1 (#540) --- go.mod | 20 ++++++++++---------- go.sum | 37 ++++++++++++++++--------------------- hub/connection_factory.go | 2 +- hub/hub_base.go | 13 +++++++------ hub/hub_local.go | 2 +- hub/hub_remote.go | 6 +++--- schema.go | 6 +++--- types/pathkeys.go | 4 ++-- 8 files changed, 43 insertions(+), 47 deletions(-) diff --git a/go.mod b/go.mod index ce9dc536..095bafe3 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,24 @@ module github.com/turbot/steampipe-postgres-fdw -go 1.22.4 +go 1.23.1 + +toolchain go1.23.3 require ( - github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/dgraph-io/ristretto v0.2.0 // indirect github.com/golang/protobuf v1.5.4 github.com/hashicorp/go-hclog v1.6.3 github.com/hashicorp/go-version v1.7.0 // indirect - github.com/turbot/go-kit v0.10.0-rc.0 - github.com/turbot/steampipe v1.0.2 - github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2 + github.com/turbot/go-kit v1.0.0 + github.com/turbot/steampipe v1.7.0-rc.0.0.20250210104953-c81e20d80731 + github.com/turbot/steampipe-plugin-sdk/v5 v5.11.3 go.opentelemetry.io/otel v1.26.0 google.golang.org/protobuf v1.34.2 ) require ( github.com/Masterminds/semver/v3 v3.2.1 - github.com/turbot/pipe-fittings v1.6.8 + github.com/turbot/pipe-fittings/v2 v2.1.1 go.opentelemetry.io/otel/metric v1.26.0 ) @@ -77,7 +79,6 @@ require ( github.com/leodido/go-urn v1.4.0 // indirect github.com/moby/locker v1.0.1 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect - github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rs/xid v1.5.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect @@ -85,7 +86,7 @@ require ( github.com/spf13/cobra v1.8.1 // indirect github.com/thediveo/enumflag/v2 v2.0.5 // indirect github.com/turbot/pipes-sdk-go v0.12.0 // indirect - github.com/turbot/steampipe-plugin-code v0.7.0 // indirect + github.com/turbot/steampipe-plugin-code v1.0.1-alpha.1 // indirect github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7 // indirect github.com/ulikunitz/xz v0.5.10 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect @@ -118,7 +119,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/containerd v1.7.23 // indirect github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/fatih/color v1.17.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gertd/go-pluralize v0.2.1 @@ -126,7 +127,6 @@ require ( github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/golang/glog v1.2.4 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/go.sum b/go.sum index e1f8af50..7e42d744 100644 --- a/go.sum +++ b/go.sum @@ -300,12 +300,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= -github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dgraph-io/ristretto v0.2.0 h1:XAfl+7cmoUDWW/2Lx8TGZQjjxIQ2Ley9DSf52dru4WE= +github.com/dgraph-io/ristretto v0.2.0/go.mod h1:8uBHCU/PBV4Ag0CJrP47b9Ofby5dqWNh4FicAdoqFNU= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eko/gocache/lib/v4 v4.1.6 h1:5WWIGISKhE7mfkyF+SJyWwqa4Dp2mkdX8QsZpnENqJI= github.com/eko/gocache/lib/v4 v4.1.6/go.mod h1:HFxC8IiG2WeRotg09xEnPD72sCheJiTSr4Li5Ameg7g= github.com/eko/gocache/store/bigcache/v4 v4.2.1 h1:xf9R5HZqmrfT4+NzlJPQJQUWftfWW06FHbjz4IEjE08= @@ -385,8 +385,6 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= -github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -683,8 +681,6 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= -github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= @@ -753,18 +749,18 @@ github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2bi github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQSepKdE= github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4= -github.com/turbot/go-kit v0.10.0-rc.0 h1:kd+jp2ibbIV33Hc8SsMAN410Dl9Pz6SJ40axbKUlSoA= -github.com/turbot/go-kit v0.10.0-rc.0/go.mod h1:fFQqR59I5z5JeeBLfK1PjSifn4Oprs3NiQx0CxeSJxs= -github.com/turbot/pipe-fittings v1.6.8 h1:cIzFQdHU081IyyWff9R3ieR9fzIxdB3kiSZxwl1K6oc= -github.com/turbot/pipe-fittings v1.6.8/go.mod h1:CYlcJEGHs39ZSHJm1iHXtQSSaUApJZMQ5M7XeZj8pEc= +github.com/turbot/go-kit v1.0.0 h1:TeVYepMyPMpiQ8GxmZcth9h1CzKRshWK+X9JGKAnXOo= +github.com/turbot/go-kit v1.0.0/go.mod h1:vPk4gTUM8HhYGdzfKKLrPeZgnjLVBin41uqxjHScz6k= +github.com/turbot/pipe-fittings/v2 v2.1.1 h1:sV6bviX7WH3zivi45n29+ui+I9tJLlFNCNA2rOpw6/U= +github.com/turbot/pipe-fittings/v2 v2.1.1/go.mod h1:mGFH8dfDQOdv+d1fNL2r3ex+qlnVrTi3xGKZRVxoCEU= github.com/turbot/pipes-sdk-go v0.12.0 h1:esbbR7bALa5L8n/hqroMPaQSSo3gNM/4X0iTmHa3D6U= github.com/turbot/pipes-sdk-go v0.12.0/go.mod h1:Mb+KhvqqEdRbz/6TSZc2QWDrMa5BN3E4Xw+gPt2TRkc= -github.com/turbot/steampipe v1.0.2 h1:DDOyobm4lk6GLWmfwNtjB47YEbkoDmGMOlXvmTWDVsU= -github.com/turbot/steampipe v1.0.2/go.mod h1:MmQAJWZXBzGczTukxRaflQC93zpYaVvm8GZfpJsE7u4= -github.com/turbot/steampipe-plugin-code v0.7.0 h1:SROYIo/TI/Q/YNfXK+sAIS71umypUFm1Uz851TmoJkM= -github.com/turbot/steampipe-plugin-code v0.7.0/go.mod h1:GvdjncWum4sZNmR0iM03SKkIzl7aZKAFtIsyAR+z4YI= -github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2 h1:oOOM5lk1RGnXUKYYAhsxcK45TcTuKUeE+r8lA3UYJAQ= -github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2/go.mod h1:JJVjTmepkwUSC7BgXyyYCvtmhuLXAEathl737Qs4Mls= +github.com/turbot/steampipe v1.7.0-rc.0.0.20250210104953-c81e20d80731 h1:5nZMBweevlTHK1tAyqvuKuaBkhUvxatYtT2yNxAbAkk= +github.com/turbot/steampipe v1.7.0-rc.0.0.20250210104953-c81e20d80731/go.mod h1:tGfEzPyhwuQEcJY2eQMO7k/TfAvFF2mTWzgP5L9B/u0= +github.com/turbot/steampipe-plugin-code v1.0.1-alpha.1 h1:mN0k0SGAN0pqPh92QZfJIzFzXuz6TiMALnLLLgCqnTI= +github.com/turbot/steampipe-plugin-code v1.0.1-alpha.1/go.mod h1:Dhkl99FVa9eHbBbHgyy0Zf6jj7eVjZZujyqore+RHmQ= +github.com/turbot/steampipe-plugin-sdk/v5 v5.11.3 h1:/b+ZUVydvkvjtNB0LbzVkDoWy/GB0qrucAxiUg4yznM= +github.com/turbot/steampipe-plugin-sdk/v5 v5.11.3/go.mod h1:zI1JuJjVV+tiqK1MbOfEfeyHJzONRQh/NEYVXEOyd4o= github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7 h1:qDMxFVd8Zo0rIhnEBdCIbR+T6WgjwkxpFZMN8zZmmjg= github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7/go.mod h1:5hzpfalEjfcJWp9yq75/EZoEu2Mzm34eJAPm3HOW2tw= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= @@ -1045,7 +1041,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= diff --git a/hub/connection_factory.go b/hub/connection_factory.go index 069b51dc..4119cd7c 100644 --- a/hub/connection_factory.go +++ b/hub/connection_factory.go @@ -6,7 +6,7 @@ import ( "strings" "sync" - "github.com/turbot/pipe-fittings/utils" + "github.com/turbot/pipe-fittings/v2/utils" "github.com/turbot/steampipe/pkg/pluginmanager" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" diff --git a/hub/hub_base.go b/hub/hub_base.go index 6ba59938..4b0b1adc 100644 --- a/hub/hub_base.go +++ b/hub/hub_base.go @@ -3,7 +3,11 @@ package hub import ( "context" "fmt" - "github.com/turbot/go-kit/helpers" + "log" + "slices" + "strings" + "sync" + "github.com/turbot/steampipe-plugin-sdk/v5/grpc" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/telemetry" @@ -14,9 +18,6 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" - "log" - "strings" - "sync" ) type hubBase struct { @@ -319,7 +320,7 @@ func (h *hubBase) GetSettingsSchema() map[string]*proto.TableSchema { func (h *hubBase) ValidateCacheCommand(command string) error { validCommands := []string{constants.LegacyCommandCacheClear, constants.LegacyCommandCacheOn, constants.LegacyCommandCacheOff} - if !helpers.StringSliceContains(validCommands, command) { + if !slices.Contains(validCommands, command) { return fmt.Errorf("invalid command '%s' - supported commands are %s", command, strings.Join(validCommands, ",")) } return nil @@ -419,7 +420,7 @@ func (h *hubBase) shouldPushdownLimit(table string, qualMap map[string]*proto.Qu // check whether every qual for this column has a supported operator for _, q := range quals.Quals { operator := q.GetStringValue() - if !helpers.StringSliceContains(k.Operators, operator) { + if !slices.Contains(k.Operators, operator) { log.Printf("[INFO] operator '%s' not supported for column '%s'. NOT pushing down limit", operator, col) return false } diff --git a/hub/hub_local.go b/hub/hub_local.go index e676addc..ab9dc630 100644 --- a/hub/hub_local.go +++ b/hub/hub_local.go @@ -6,7 +6,7 @@ import ( "time" typehelpers "github.com/turbot/go-kit/types" - "github.com/turbot/pipe-fittings/ociinstaller" + "github.com/turbot/pipe-fittings/v2/ociinstaller" "github.com/turbot/steampipe-plugin-sdk/v5/grpc" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/logging" diff --git a/hub/hub_remote.go b/hub/hub_remote.go index 825e462a..40809fa5 100644 --- a/hub/hub_remote.go +++ b/hub/hub_remote.go @@ -10,9 +10,9 @@ import ( "time" typehelpers "github.com/turbot/go-kit/types" - "github.com/turbot/pipe-fittings/app_specific" - "github.com/turbot/pipe-fittings/modconfig" - "github.com/turbot/pipe-fittings/utils" + "github.com/turbot/pipe-fittings/v2/app_specific" + "github.com/turbot/pipe-fittings/v2/modconfig" + "github.com/turbot/pipe-fittings/v2/utils" "github.com/turbot/steampipe-plugin-sdk/v5/grpc" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/logging" diff --git a/schema.go b/schema.go index 48a201c2..d9cd14e5 100644 --- a/schema.go +++ b/schema.go @@ -9,9 +9,9 @@ import "C" import ( "log" + "slices" "unsafe" - "github.com/turbot/go-kit/helpers" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-postgres-fdw/sql" ) @@ -44,7 +44,7 @@ func SchemaToSql(schema map[string]*proto.TableSchema, stmt *C.ImportForeignSche if stmt.list_type == C.FDW_IMPORT_SCHEMA_LIMIT_TO { log.Printf("[TRACE] list_type is FDW_IMPORT_SCHEMA_LIMIT_TO: %v", tables) - if !helpers.StringSliceContains(tables, table) { + if !slices.Contains(tables, table) { log.Printf("[TRACE] Skipping table %s", table) continue @@ -52,7 +52,7 @@ func SchemaToSql(schema map[string]*proto.TableSchema, stmt *C.ImportForeignSche } else if stmt.list_type == C.FDW_IMPORT_SCHEMA_EXCEPT { log.Printf("[TRACE] list_type is FDW_IMPORT_SCHEMA_EXCEPT: %v", tables) - if helpers.StringSliceContains(tables, table) { + if slices.Contains(tables, table) { log.Printf("[TRACE] Skipping table %s", table) continue } diff --git a/types/pathkeys.go b/types/pathkeys.go index 58d187e8..15bb9229 100644 --- a/types/pathkeys.go +++ b/types/pathkeys.go @@ -2,10 +2,10 @@ package types import ( "log" + "slices" "sort" "strings" - "github.com/turbot/go-kit/helpers" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" ) @@ -169,7 +169,7 @@ func columnPathsToPathKeys(columnPaths [][]string, allColumns []string, baseCost }) // also create paths for the columns path WITH each other column for _, c := range allColumns { - if !helpers.StringSliceContains(s, c) { + if !slices.Contains(s, c) { // NOTE: create a new slice rather than appending onto s - to avoid clash between loop iterations columnNames := append([]string{c}, s...) From 06b07aea1b594cc0fd3cca8cba77485c57616a55 Mon Sep 17 00:00:00 2001 From: Puskar Basu Date: Wed, 12 Feb 2025 00:22:42 +0530 Subject: [PATCH 06/10] v1.12.4 --- CHANGELOG.md | 4 ++++ version/version.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 285488ea..311e7660 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.12.4 [2024-02-11] +_Dependencies_ +- Upgrade `pipe-fittings` to v2.1.1 and `go-kit` to v1.0.0. + ## v1.12.3 [2024-02-05] _Dependencies_ - Upgrade `pipe-fittings` to v1.6.8 and `steampipe-plugin-sdk` to v5.11.2. diff --git a/version/version.go b/version/version.go index 4a9d0d05..835c4903 100644 --- a/version/version.go +++ b/version/version.go @@ -11,7 +11,7 @@ import ( ) // The main version number that is being run at the moment. -var fdwVersion = "1.12.3" +var fdwVersion = "1.12.4" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release From b2129a5a0533a6818074e7ce1149e8b485d36c45 Mon Sep 17 00:00:00 2001 From: Puskar Basu Date: Thu, 1 May 2025 10:21:30 +0530 Subject: [PATCH 07/10] github actions: pin actions to commit SHAs --- .github/workflows/buildimage.yml | 58 ++++++++++++++++---------------- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 20 +++++------ 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/buildimage.yml b/.github/workflows/buildimage.yml index 256c1d6b..aa6bea27 100644 --- a/.github/workflows/buildimage.yml +++ b/.github/workflows/buildimage.yml @@ -38,10 +38,10 @@ jobs: ls -l $INTERNAL_LIB - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Golang - uses: actions/setup-go@v5 + uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 with: go-version: 1.22 @@ -53,14 +53,14 @@ jobs: - name: Go Build Cache id: build-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-build }} key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - name: Go Mod Cache id: mod-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} @@ -113,21 +113,21 @@ jobs: mv build-Darwin/steampipe_postgres_fdw.so.gz build-Darwin/steampipe_postgres_fdw.so.darwin_amd64.gz - name: Save MacOS Build Artifact - AMD64 - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: steampipe_postgres_fdw.so.darwin_amd64 path: build-Darwin/steampipe_postgres_fdw.so.darwin_amd64.gz if-no-files-found: error - name: Save steampipe_postgres_fdw.control # only need this once for ALL platforms - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: steampipe_postgres_fdw.control path: ./fdw/steampipe_postgres_fdw.control if-no-files-found: error - name: Save steampipe_postgres_fdw--1.0.sql # only need this once for ALL platforms - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: steampipe_postgres_fdw--1.0.sql path: ./fdw/steampipe_postgres_fdw--1.0.sql @@ -157,10 +157,10 @@ jobs: ls -l $INTERNAL_LIB - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Golang - uses: actions/setup-go@v5 + uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 with: go-version: 1.22 @@ -172,14 +172,14 @@ jobs: - name: Go Build Cache id: build-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-build }} key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - name: Go Mod Cache id: mod-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} @@ -232,7 +232,7 @@ jobs: mv build-Darwin/steampipe_postgres_fdw.so.gz build-Darwin/steampipe_postgres_fdw.so.darwin_arm64.gz - name: Save MacOS Build Artifact - AMD64 - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: steampipe_postgres_fdw.so.darwin_arm64 path: build-Darwin/steampipe_postgres_fdw.so.darwin_arm64.gz @@ -243,10 +243,10 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup GoLang - uses: actions/setup-go@v5 + uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 with: go-version: 1.22 @@ -258,14 +258,14 @@ jobs: - name: Go Build Cache id: build-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-build }} key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - name: Go Mod Cache id: mod-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} @@ -317,7 +317,7 @@ jobs: mv build-Linux/steampipe_postgres_fdw.so.gz build-Linux/steampipe_postgres_fdw.so.linux_amd64.gz - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: steampipe_postgres_fdw.so.linux_amd64 path: build-Linux/steampipe_postgres_fdw.so.linux_amd64.gz @@ -328,10 +328,10 @@ jobs: runs-on: ubuntu-22.04-arm steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup GoLang - uses: actions/setup-go@v5 + uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 with: go-version: 1.22 @@ -343,14 +343,14 @@ jobs: - name: Go Build Cache id: build-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-build }} key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - name: Go Mod Cache id: mod-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} @@ -402,7 +402,7 @@ jobs: mv build-Linux/steampipe_postgres_fdw.so.gz build-Linux/steampipe_postgres_fdw.so.linux_arm64.gz - name: Save Linux Build Artifact - AMD64 - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: steampipe_postgres_fdw.so.linux_arm64 path: build-Linux/steampipe_postgres_fdw.so.linux_arm64.gz @@ -433,37 +433,37 @@ jobs: - name: Download steampipe_postgres_fdw.so - darwin_amd64 id: download_fdw_so_darwin_amd64 - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: steampipe_postgres_fdw.so.darwin_amd64 - name: Download steampipe_postgres_fdw.so - darwin_arm64 id: download_fdw_so_darwin_arm64 - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: steampipe_postgres_fdw.so.darwin_arm64 - name: Download steampipe_postgres_fdw.so - linux_amd64 id: download_fdw_so_linux_amd64 - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: steampipe_postgres_fdw.so.linux_amd64 - name: Download steampipe_postgres_fdw.so - linux_arm64 id: download_fdw_so_linux_arm64 - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: steampipe_postgres_fdw.so.linux_arm64 - name: Download steampipe_postgres_fdw.control id: download_fdw_control - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: steampipe_postgres_fdw.control - name: Download steampipe_postgres_fdw--1.0.sql id: download_fdw_sql - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: steampipe_postgres_fdw--1.0.sql @@ -472,7 +472,7 @@ jobs: ls -la - name: Create a draft release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2 id: create_draft_release with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1e0eee63..dbfcb7cf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -47,7 +47,7 @@ jobs: # Login to GHCR - name: Log in to the Container registry - uses: docker/login-action@v2 + uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 with: registry: ghcr.io username: ${{ github.repository_owner }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ee9ad42..488419ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,15 +8,15 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 with: go-version: 1.22 - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2 continue-on-error: true # we dont want to enforce just yet with: version: v1.52.2 @@ -28,12 +28,12 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 with: go-version: 1.22 - name: Checkout Steampipe - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: true repository: turbot/steampipe @@ -47,14 +47,14 @@ jobs: - name: Go Build Cache id: build-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-build }} key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - name: Go Mod Cache id: mod-cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} @@ -72,7 +72,7 @@ jobs: steampipe query "select 1 as col" - name: Checkout FDW - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: turbot/steampipe-postgres-fdw path: steampipe-postgres-fdw @@ -120,13 +120,13 @@ jobs: tar -czvf ../build.tar.gz ./build-$(uname) - name: Upload FDW Build - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: fdw-build path: build.tar.gz - name: Setup BATS - uses: mig4/setup-bats@v1 + uses: mig4/setup-bats@af9a00deb21b5d795cabfeaa8d9060410377686d # v1.2.0 with: bats-version: 1.2.1 From 883869caeaf12cccfc6bc0680778e43c948647d6 Mon Sep 17 00:00:00 2001 From: Puskar Basu Date: Thu, 1 May 2025 10:24:00 +0530 Subject: [PATCH 08/10] feat: add stale workflow --- .github/workflows/stale.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..c2053c99 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,39 @@ +name: Stale Issues and PRs +on: + schedule: + - cron: "0 8 * * *" + workflow_dispatch: + inputs: + dryRun: + description: Set to true for a dry run + required: false + default: "false" + type: string + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - name: Stale issues and PRs + id: stale-issues-and-prs + uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 + with: + close-issue-message: | + This issue was closed because it has been stalled for 90 days with no activity. + close-issue-reason: 'not_planned' + close-pr-message: | + This PR was closed because it has been stalled for 90 days with no activity. + # Set days-before-close to 30 because we want to close the issue/PR after 90 days total, since days-before-stale is set to 60 + days-before-close: 30 + days-before-stale: 60 + debug-only: ${{ inputs.dryRun }} + exempt-issue-labels: 'good first issue,help wanted' + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-label: 'stale' + stale-issue-message: | + This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. + stale-pr-label: 'stale' + stale-pr-message: | + This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. + start-date: "2021-02-09" + operations-per-run: 1000 From df6ec9d3e54abc6db99b0d2e8afd160d13dd67ae Mon Sep 17 00:00:00 2001 From: Puskar Basu Date: Mon, 26 May 2025 17:21:16 +0530 Subject: [PATCH 09/10] Add support to build steampipe standalone FDW for pre-release versions of plugins --- Makefile | 30 +++++++++++++++++++++++------- generate/generator.go | 24 ++++++++++++++++++------ 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 6f097d38..33ff6f63 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ install: build fi # build standalone -standalone: validate_plugin prebuild.go +standalone: validate_plugin validate_version prebuild.go @echo "Building standalone FDW for plugin: $(plugin)" # Remove existing work dir and create a new directory for the render process @@ -26,7 +26,11 @@ standalone: validate_plugin prebuild.go # Change to the new directory to perform operations cd work && \ - go run generate/generator.go templates . $(plugin) $(plugin_github_url) && \ + go run generate/generator.go templates . $(plugin) $(plugin_version) $(plugin_github_url) && \ + if [ ! -z "$(plugin_version)" ]; then \ + echo "go get $(plugin_github_url)@$(plugin_version)" && \ + go get $(plugin_github_url)@$(plugin_version); \ + fi && \ go mod tidy && \ $(MAKE) -C ./fdw clean && \ $(MAKE) -C ./fdw go && \ @@ -43,7 +47,7 @@ standalone: validate_plugin prebuild.go # binaries will be copied to build-${PLATFORM} folder # render target -render: validate_plugin prebuild.go +render: validate_plugin validate_version prebuild.go @echo "Rendering code for plugin: $(plugin)" # Remove existing work dir and create a new directory for the render process @@ -55,7 +59,11 @@ render: validate_plugin prebuild.go # Change to the new directory to perform operations cd work && \ - go run generate/generator.go templates . $(plugin) $(plugin_github_url) && \ + go run generate/generator.go templates . $(plugin) $(plugin_version) $(plugin_github_url) && \ + if [ ! -z "$(plugin_version)" ]; then \ + echo "go get $(plugin_github_url)@$(plugin_version)" && \ + go get $(plugin_github_url)@$(plugin_version); \ + fi && \ go mod tidy # Note: The work directory will contain the full code tree with rendered changes @@ -84,9 +92,17 @@ build_from_work: # Note: This target builds from the 'work' directory and copies binaries to the build-${PLATFORM} folder validate_plugin: - ifndef plugin - $(error "You must specify the 'plugin' variable") - endif +ifndef plugin + $(error "The 'plugin' variable is missing. Usage: make build plugin= [plugin_version=] [plugin_github_url=]") +endif + +# Check if plugin_github_url is provided when plugin_version is specified +validate_version: +ifdef plugin_version +ifndef plugin_github_url + $(error "The 'plugin_github_url' variable is required when 'plugin_version' is specified") +endif +endif build: prebuild.go $(MAKE) -C ./fdw clean diff --git a/generate/generator.go b/generate/generator.go index 7a5f1c3c..edc8f675 100644 --- a/generate/generator.go +++ b/generate/generator.go @@ -15,7 +15,7 @@ import ( const templateExt = ".tmpl" -func RenderDir(templatePath, root, plugin, pluginGithubUrl, pgVersion string) { +func RenderDir(templatePath, root, plugin, pluginGithubUrl, pluginVersion, pgVersion string) { var targetFilePath string err := filepath.Walk(templatePath, func(filePath string, info os.FileInfo, err error) error { if err != nil { @@ -64,10 +64,12 @@ func RenderDir(templatePath, root, plugin, pluginGithubUrl, pgVersion string) { data := struct { Plugin string PluginGithubUrl string + PluginVersion string PgVersion string }{ plugin, pluginGithubUrl, + pluginVersion, pgVersion, } @@ -95,25 +97,35 @@ func RenderDir(templatePath, root, plugin, pluginGithubUrl, pgVersion string) { func main() { // Check if the correct number of command-line arguments are provided if len(os.Args) < 4 { - fmt.Println("Usage: go run generator.go [pluginGithubUrl]") + fmt.Println("Usage: go run generator.go [plugin_version] [pluginGithubUrl]") return } templatePath := os.Args[1] root := os.Args[2] plugin := os.Args[3] + var pluginVersion string var pluginGithubUrl string - fmt.Println(len(os.Args)) + // Check if pluginVersion is provided as a command-line argument + if len(os.Args) >= 5 { + pluginVersion = os.Args[4] + } // Check if PluginGithubUrl is provided as a command-line argument - if len(os.Args) == 5 { - pluginGithubUrl = os.Args[4] + if len(os.Args) >= 6 { + pluginGithubUrl = os.Args[5] } else { // If PluginGithubUrl is not provided, generate it based on PluginAlias pluginGithubUrl = "github.com/turbot/steampipe-plugin-" + plugin } + // If pluginVersion is provided but pluginGithubUrl is not, error out + if pluginVersion != "" && pluginGithubUrl == "" { + fmt.Println("Error: plugin_github_url is required when plugin_version is specified") + return + } + // Convert relative paths to absolute paths absTemplatePath, err := filepath.Abs(templatePath) if err != nil { @@ -130,7 +142,7 @@ func main() { // get the postgres version used pgVersion := getPostgreSQLVersion() - RenderDir(absTemplatePath, absRoot, plugin, pluginGithubUrl, pgVersion) + RenderDir(absTemplatePath, absRoot, plugin, pluginGithubUrl, pluginVersion, pgVersion) } func getPostgreSQLVersion() string { From e5e395d01197b807baf65b80422e8e426309b86f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 08:55:58 +0000 Subject: [PATCH 10/10] [Dependabot](deps): Bump golang.org/x/net from 0.36.0 to 0.38.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.36.0 to 0.38.0. - [Commits](https://github.com/golang/net/compare/v0.36.0...v0.38.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-version: 0.38.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 446854f8..0dfc7299 100644 --- a/go.mod +++ b/go.mod @@ -94,7 +94,7 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.9.0 // indirect golang.org/x/mod v0.19.0 // indirect - golang.org/x/term v0.29.0 // indirect + golang.org/x/term v0.30.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.23.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect @@ -194,13 +194,13 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.26.0 // indirect go.opentelemetry.io/otel/trace v1.26.0 // indirect go.opentelemetry.io/proto/otlp v1.2.0 // indirect - golang.org/x/crypto v0.35.0 // indirect + golang.org/x/crypto v0.36.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 - golang.org/x/net v0.36.0 // indirect + golang.org/x/net v0.38.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/text v0.22.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/text v0.23.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/grpc v1.66.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 178bb33e..cca4ff11 100644 --- a/go.sum +++ b/go.sum @@ -764,8 +764,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -853,8 +853,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= -golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -896,8 +896,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -969,13 +969,13 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -986,8 +986,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=