From 3f83cfacba14189ff00b1d84d47e629d0dbad2a9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 22 Feb 2024 11:23:48 -0500 Subject: [PATCH 1/6] make: Default tidy to default Go version --- GNUmakefile | 21 +++++++++++++++------ tools/tfsdk2fw/go.mod | 1 + tools/tfsdk2fw/go.sum | 2 ++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 9134031c05a..e28a1d621d9 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -96,12 +96,21 @@ cleango: ## Clean up Go cache cleantidy: ## Clean up tidy @echo "make: tidying Go mods..." - cd .ci/providerlint && $(GO_VER) mod tidy - cd tools/tfsdk2fw && $(GO_VER) mod tidy - cd .ci/tools && $(GO_VER) mod tidy - cd .ci/providerlint && $(GO_VER) mod tidy - cd skaff && $(GO_VER) mod tidy - @$(GO_VER) mod tidy + @gover="$(GO_VER)" ; \ + if [ "$$gover" = "go" ] ; then \ + gover=go`cat .go-version | xargs` ; \ + echo "make: WARNING: no version provided so tidying with $$gover" ; \ + echo "make: tidying with newer versions can make go.mod incompatible" ; \ + echo "make: to use a different version, use 'GO_VER=go1.16 make cleantidy'" ; \ + echo "make: to use the version in .go-version, use 'make cleantidy'" ; \ + echo "make: if you get an error, see https://go.dev/doc/manage-install to locally install various Go versions" ; \ + fi ; \ + cd .ci/providerlint && $$gover mod tidy && cd ../.. ; \ + cd tools/tfsdk2fw && $$gover mod tidy && cd ../.. ; \ + cd .ci/tools && $$gover mod tidy && cd ../.. ; \ + cd .ci/providerlint && $$gover mod tidy && cd ../.. ; \ + cd skaff && $$gover mod tidy && cd .. ; \ + $$gover mod tidy @echo "make: Go mods tidied" clean: cleango cleantidy build tools ## Clean up Go cache, tidy and re-install tools diff --git a/tools/tfsdk2fw/go.mod b/tools/tfsdk2fw/go.mod index 8ad8b74d37c..8373aed68b3 100644 --- a/tools/tfsdk2fw/go.mod +++ b/tools/tfsdk2fw/go.mod @@ -127,6 +127,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/qldb v1.20.2 // indirect github.com/aws/aws-sdk-go-v2/service/rbin v1.15.2 // indirect github.com/aws/aws-sdk-go-v2/service/rds v1.71.2 // indirect + github.com/aws/aws-sdk-go-v2/service/redshift v1.42.2 // indirect github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.24.3 // indirect github.com/aws/aws-sdk-go-v2/service/redshiftserverless v1.16.4 // indirect github.com/aws/aws-sdk-go-v2/service/rekognition v1.38.2 // indirect diff --git a/tools/tfsdk2fw/go.sum b/tools/tfsdk2fw/go.sum index 3b432e53f00..ec126efa373 100644 --- a/tools/tfsdk2fw/go.sum +++ b/tools/tfsdk2fw/go.sum @@ -240,6 +240,8 @@ github.com/aws/aws-sdk-go-v2/service/rbin v1.15.2 h1:3WgCnpykFdYVMEqe48VSSDEtHlV github.com/aws/aws-sdk-go-v2/service/rbin v1.15.2/go.mod h1:twjAy0rzJI3a4gLElW+9kGq9POXxMZrVZgy8/m3s7vA= github.com/aws/aws-sdk-go-v2/service/rds v1.71.2 h1:RjlhYRut7x9YB2osQkEXqpDZxbWlK1B6Oqq1GTgh6e0= github.com/aws/aws-sdk-go-v2/service/rds v1.71.2/go.mod h1:DSeprnsj3WlGLGUZOSNopiS9vAJ8O3mELgOk6xdYxHI= +github.com/aws/aws-sdk-go-v2/service/redshift v1.42.2 h1:zueJxn5Ib3djyG1Q8YRuOOsIbnPkB4W7v2McIsjrzGI= +github.com/aws/aws-sdk-go-v2/service/redshift v1.42.2/go.mod h1:dz/YBEp+Bq5tJka7Of0J3mW+FKXEWrCOXPU7x/OCsr4= github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.24.3 h1:yt16uONP3LGMhvTfeZmA1JWOzCAxNxbm5U6vry2Rd+g= github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.24.3/go.mod h1:r1F7/i9zaT/1pv0wsERnNVgT+VZMbrRV7eH54ea1EnA= github.com/aws/aws-sdk-go-v2/service/redshiftserverless v1.16.4 h1:PN3J849dN9LDP/HJ18Jv3iA/koME2J3W+2qUyNzjOrk= From a70e055a16e21ca4fc4ce44d242afef84d57c8cf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 22 Feb 2024 11:35:18 -0500 Subject: [PATCH 2/6] ci: Use make dependency checks --- .github/workflows/dependencies.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 2382a62f0f3..345f4234c8c 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -75,8 +75,4 @@ jobs: with: go-version-file: go.mod - name: go mod - run: | - echo "==> Checking source code with go mod tidy..." - go mod tidy - git diff --exit-code -- go.mod go.sum || \ - (echo; echo "Unexpected difference in go.mod/go.sum files. Run 'go mod tidy' command or revert any go.mod/go.sum changes and commit."; exit 1) + run: make depscheck From bc060866a65cc002d4712281617a986cdb3eae2b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 22 Feb 2024 11:42:05 -0500 Subject: [PATCH 3/6] ci: Dependencies --- .github/workflows/dependencies.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 345f4234c8c..cd62ed311c6 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -75,4 +75,6 @@ jobs: with: go-version-file: go.mod - name: go mod - run: make depscheck + run: | + echo "Using make to check dependencies" + make depscheck From 3d6fa27abbf99b3cb71007fb6e023ecf5d35590f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 22 Feb 2024 11:49:51 -0500 Subject: [PATCH 4/6] ci: Improve dependency check --- .github/workflows/dependencies.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index cd62ed311c6..875eafb713b 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -76,5 +76,8 @@ jobs: go-version-file: go.mod - name: go mod run: | + gover=go`cat .go-version | xargs` + go install golang.org/dl/${gover}@latest + ${gover} download echo "Using make to check dependencies" make depscheck From e0146dc3d51a0caf0618289dd80a6ae6e884a490 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 22 Feb 2024 11:51:24 -0500 Subject: [PATCH 5/6] ci: Improve dependency check --- .github/workflows/dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 875eafb713b..ad0041db823 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -70,7 +70,7 @@ jobs: name: go mod runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + #- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: go.mod From 274edc54681febecbae8e2afef32ca5e74bf97e4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 22 Feb 2024 11:57:40 -0500 Subject: [PATCH 6/6] ci: Improve dependency check --- .github/workflows/dependencies.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index ad0041db823..f82378682ce 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -70,10 +70,10 @@ jobs: name: go mod runs-on: ubuntu-latest steps: - #- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version-file: go.mod + go-version-file: .go-version - name: go mod run: | gover=go`cat .go-version | xargs`