From 7bd92eb6317fc2fc6c9157541ac197fe11331724 Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 18 Jul 2024 02:50:31 -0700 Subject: [PATCH 1/8] finish off Go 1.22 upgrade This patch cleans up some stragglers in the CircleCI config that were still running on 1.19. We also specify the patch version of Go in go.mod as that's what the `1.22` tooling (and, I believe, 1.21) does. If we don't do that, various third party tools like GitHub's CodeQL can break (see https://github.com/github/codeql/issues/15647 for the last time I ran into this). This patch change is actually what clued me into the CircleCI version bumps that were missing. --- .circleci/config.yml | 6 +++--- go.mod | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c90eefd7..896389a7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,7 +38,7 @@ jobs: command: | make vet make -C tools/autograph-monitor vet - make -C verifier/contentsignature vet + make -C verifier/contentsignature vet - run: name: run staticcheck command: | @@ -50,7 +50,7 @@ jobs: unit-test: # based on the official golang image with more docker stuff docker: - - image: cimg/go:1.19 + - image: cimg/go:1.22 auth: username: $DOCKER_USER password: $DOCKER_PASS @@ -80,7 +80,7 @@ jobs: build-integrationtest-verify: # based on the official golang image with more docker stuff docker: - - image: cimg/go:1.19 + - image: cimg/go:1.22 auth: username: $DOCKER_USER password: $DOCKER_PASS diff --git a/go.mod b/go.mod index 221b13de6..206efb888 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/mozilla-services/autograph -go 1.22 +go 1.22.5 require ( github.com/DataDog/datadog-go v3.7.2+incompatible @@ -8,6 +8,7 @@ require ( github.com/aws/aws-lambda-go v1.27.0 github.com/aws/aws-sdk-go v1.42.15 github.com/golang/mock v1.6.0 + github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.0 github.com/hashicorp/golang-lru v0.5.4 github.com/lib/pq v1.10.4 @@ -40,7 +41,6 @@ require ( github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect github.com/golang/protobuf v1.3.2 // indirect - github.com/google/uuid v1.6.0 // indirect github.com/googleapis/gax-go/v2 v2.0.5 // indirect github.com/goware/prefixer v0.0.0-20160118172347-395022866408 // indirect github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c // indirect From be8bf59494cb1b53aeb292f786b63b4538fe0946 Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 18 Jul 2024 02:59:31 -0700 Subject: [PATCH 2/8] use go image for vet code --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 896389a7c..a481101d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ version: 2.1 jobs: lint-vet-fmt: docker: - - image: debian:bookworm + - image: cimg/go:1.22 steps: - run: name: install dependencies From eff92da4b27138f5c6256aab331be0270b1b0c81 Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 18 Jul 2024 03:04:04 -0700 Subject: [PATCH 3/8] back to bookworm --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a481101d0..7c8fb13eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,13 +8,14 @@ version: 2.1 jobs: lint-vet-fmt: docker: - - image: cimg/go:1.22 + - image: debian:bookworm steps: - run: name: install dependencies + # TODO(AUT-158): installing Go differently for tests than linting is bad command: | apt-get update - apt-get install -y golang build-essential git ca-certificates libltdl-dev + apt-get install -y golang-1.22 build-essential git ca-certificates libltdl-dev - checkout - run: name: check crypto11 not used in signers From 52ea30e21ad6387d0cedd8d0e1d7e16bbeffa3e1 Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 18 Jul 2024 03:08:38 -0700 Subject: [PATCH 4/8] add backports --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c8fb13eb..2ef52140f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,8 @@ jobs: name: install dependencies # TODO(AUT-158): installing Go differently for tests than linting is bad command: | + echo "deb http://deb.debian.org/debian/ bookworm-backports main" > /etc/apt/sources.list.d/bookworm-backports.list + echo "deb-src http://deb.debian.org/debian/ bookworm-backports main" >> /etc/apt/sources.list.d/bookworm-backports.list apt-get update apt-get install -y golang-1.22 build-essential git ca-certificates libltdl-dev - checkout From 22e66668db2398c5a29018a1ddb33fa8f7a7e42e Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 18 Jul 2024 03:16:21 -0700 Subject: [PATCH 5/8] try exporting PATH --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ef52140f..44b88ca88 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,6 +18,7 @@ jobs: echo "deb-src http://deb.debian.org/debian/ bookworm-backports main" >> /etc/apt/sources.list.d/bookworm-backports.list apt-get update apt-get install -y golang-1.22 build-essential git ca-certificates libltdl-dev + export PATH="${PATH}:/usr/lib/go-${GO_VERSION}/bin:/go/bin" - checkout - run: name: check crypto11 not used in signers From 7e7a0c2fe5b88351ad863f2a354d3e15cf3de714 Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 18 Jul 2024 03:17:34 -0700 Subject: [PATCH 6/8] correct Go PATH --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 44b88ca88..014898bf5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ jobs: echo "deb-src http://deb.debian.org/debian/ bookworm-backports main" >> /etc/apt/sources.list.d/bookworm-backports.list apt-get update apt-get install -y golang-1.22 build-essential git ca-certificates libltdl-dev - export PATH="${PATH}:/usr/lib/go-${GO_VERSION}/bin:/go/bin" + export PATH="${PATH}:/usr/lib/go-1.22/bin:/go/bin" - checkout - run: name: check crypto11 not used in signers From 032d99a0836c2368b3dc83eaa8de8e52f514a0ed Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 18 Jul 2024 03:20:20 -0700 Subject: [PATCH 7/8] try environment across all steps --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 014898bf5..57ef42f30 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,13 +12,14 @@ jobs: steps: - run: name: install dependencies + environment: + PATH: "${PATH}:/usr/lib/go-1.22/bin" # TODO(AUT-158): installing Go differently for tests than linting is bad command: | echo "deb http://deb.debian.org/debian/ bookworm-backports main" > /etc/apt/sources.list.d/bookworm-backports.list echo "deb-src http://deb.debian.org/debian/ bookworm-backports main" >> /etc/apt/sources.list.d/bookworm-backports.list apt-get update apt-get install -y golang-1.22 build-essential git ca-certificates libltdl-dev - export PATH="${PATH}:/usr/lib/go-1.22/bin:/go/bin" - checkout - run: name: check crypto11 not used in signers From 3e6254d9f5a7eacdc5b9b1ffd62111281927e86e Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 18 Jul 2024 03:22:40 -0700 Subject: [PATCH 8/8] PATH was empty, so try BASH_ENV --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57ef42f30..424fd4671 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,13 +13,13 @@ jobs: - run: name: install dependencies environment: - PATH: "${PATH}:/usr/lib/go-1.22/bin" # TODO(AUT-158): installing Go differently for tests than linting is bad command: | echo "deb http://deb.debian.org/debian/ bookworm-backports main" > /etc/apt/sources.list.d/bookworm-backports.list echo "deb-src http://deb.debian.org/debian/ bookworm-backports main" >> /etc/apt/sources.list.d/bookworm-backports.list apt-get update apt-get install -y golang-1.22 build-essential git ca-certificates libltdl-dev + echo 'export PATH="${PATH}:/usr/lib/go-1.22/bin"' >> $BASH_ENV - checkout - run: name: check crypto11 not used in signers