From 7ff7919ff8183e9eb30e2c16662cefbbed6508a6 Mon Sep 17 00:00:00 2001 From: Miguel Molina Date: Tue, 10 Sep 2024 12:59:47 -0400 Subject: [PATCH 1/3] housekeeping: update to go 1.23 --- .github/workflows/api.yml | 4 ++-- .github/workflows/backend.yml | 8 ++++---- .github/workflows/frontend.yml | 2 +- .github/workflows/license_review.yml | 2 +- .github/workflows/scaffolding.yml | 2 +- backend/go.mod | 4 ++-- docs/_website/generator/go.mod | 2 +- tools/go.mod | 2 +- tools/golangci-lint.sh | 6 +++--- tools/scaffolding/templates/gateway/backend/go.mod.tmpl | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 72621e2b7b..ae7f107ffc 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.22.x + go-version: 1.23.x - name: Set up Node uses: actions/setup-node@v3 with: @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.22.x + go-version: 1.23.x - name: lint run: make api-lint diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index e773da30c1..d4628eedb0 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - name: go mod cache uses: actions/cache@v4 with: @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - name: go mod cache uses: actions/cache@v4 with: @@ -72,7 +72,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - run: make backend-integration-test lint: runs-on: ubuntu-latest @@ -81,7 +81,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - name: go mod cache uses: actions/cache@v4 with: diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 28cb99b45b..12f405123c 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -94,7 +94,7 @@ jobs: - uses: actions/setup-go@v4 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - uses: actions/setup-node@v4 with: node-version: "18.x" diff --git a/.github/workflows/license_review.yml b/.github/workflows/license_review.yml index cf70210830..7e3e0850e4 100644 --- a/.github/workflows/license_review.yml +++ b/.github/workflows/license_review.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - name: Install Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/scaffolding.yml b/.github/workflows/scaffolding.yml index 0bf4cfd9f6..a49bdde942 100644 --- a/.github/workflows/scaffolding.yml +++ b/.github/workflows/scaffolding.yml @@ -18,7 +18,7 @@ jobs: path: ${{ env.PACKAGEPATH }} - uses: actions/setup-go@v3 with: - go-version: 1.22.x + go-version: 1.23.x - uses: actions/setup-node@v3 with: node-version: '18.x' diff --git a/backend/go.mod b/backend/go.mod index acd9edd5e0..aa064da459 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -1,8 +1,8 @@ module github.com/lyft/clutch/backend -go 1.22.0 +go 1.23.0 -toolchain go1.22.3 +toolchain go1.23.0 require ( github.com/DATA-DOG/go-sqlmock v1.5.0 diff --git a/docs/_website/generator/go.mod b/docs/_website/generator/go.mod index b90a86f66c..f39dd2a2c5 100644 --- a/docs/_website/generator/go.mod +++ b/docs/_website/generator/go.mod @@ -1,6 +1,6 @@ module github.com/lyft/clutch/docs/website/generator -go 1.22 +go 1.23 require ( github.com/Masterminds/sprig/v3 v3.2.3 diff --git a/tools/go.mod b/tools/go.mod index 16edaa9b88..8b17795773 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,3 +1,3 @@ module github.com/lyft/clutch/tools -go 1.22 +go 1.23 diff --git a/tools/golangci-lint.sh b/tools/golangci-lint.sh index 17b2318118..78674070a8 100755 --- a/tools/golangci-lint.sh +++ b/tools/golangci-lint.sh @@ -6,9 +6,9 @@ BUILD_ROOT="${REPO_ROOT}/build" BUILD_BIN="${BUILD_ROOT}/bin" NAME=golangci-lint -RELEASE=v1.56.1 -OSX_RELEASE_256=62f02d4c0e8f6f8c77e787b8f271cdd1535eb7d2a28742e2535608652271018e -LINUX_RELEASE_256=aaf8260c76530f7571c49a7bc34b2ecd15accac21106710d47463a2313f1f663 +RELEASE=v1.61.0 +OSX_RELEASE_256=5c280ef3284f80c54fd90d73dc39ca276953949da1db03eb9dd0fbf868cc6e55 +LINUX_RELEASE_256=77cb0af99379d9a21d5dc8c38364d060e864a01bd2f3e30b5e8cc550c3a54111 ARCH=amd64 diff --git a/tools/scaffolding/templates/gateway/backend/go.mod.tmpl b/tools/scaffolding/templates/gateway/backend/go.mod.tmpl index 694faab105..1216fd41af 100644 --- a/tools/scaffolding/templates/gateway/backend/go.mod.tmpl +++ b/tools/scaffolding/templates/gateway/backend/go.mod.tmpl @@ -1,3 +1,3 @@ module {{ .RepoProvider }}/{{ .RepoOwner }}/{{ .RepoName }}/backend -go 1.22 +go 1.23 From 68947f9f2efe5799a00aa965f657febdd1da4614 Mon Sep 17 00:00:00 2001 From: Miguel Molina Date: Tue, 10 Sep 2024 13:23:09 -0400 Subject: [PATCH 2/3] some minor fixes --- backend/go.mod | 2 -- backend/service/github/github.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/go.mod b/backend/go.mod index aa064da459..304a567369 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -2,8 +2,6 @@ module github.com/lyft/clutch/backend go 1.23.0 -toolchain go1.23.0 - require ( github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/Masterminds/squirrel v1.5.4 diff --git a/backend/service/github/github.go b/backend/service/github/github.go index c0af90109b..98384f2bda 100644 --- a/backend/service/github/github.go +++ b/backend/service/github/github.go @@ -531,7 +531,7 @@ func (s *svc) GetCommit(ctx context.Context, ref *RemoteRef) (*Commit, error) { Author: commit.GetAuthor(), } - if commit.Parents != nil && len(commit.Parents) > 0 { + if len(commit.Parents) > 0 { retCommit.ParentRef = commit.Parents[0].GetSHA() } From cfd25e6c57083a03e6627227bfabb36cbe911445 Mon Sep 17 00:00:00 2001 From: Miguel Molina Date: Tue, 10 Sep 2024 13:51:39 -0400 Subject: [PATCH 3/3] lower golangci lint --- backend/module/audit/audit_test.go | 2 +- backend/module/feedback/feedback.go | 2 +- .../chaos/experimentation/terminator/terminator_test.go | 2 +- tools/golangci-lint.sh | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/module/audit/audit_test.go b/backend/module/audit/audit_test.go index 2e54bd1772..52ad18be12 100644 --- a/backend/module/audit/audit_test.go +++ b/backend/module/audit/audit_test.go @@ -152,7 +152,7 @@ func TestGetEvents(t *testing.T) { for _, test := range testCases { test := test - t.Run(fmt.Sprintf(test.id), func(t *testing.T) { + t.Run(test.id, func(t *testing.T) { t.Parallel() m := &mod{ client: auditmock.New(), diff --git a/backend/module/feedback/feedback.go b/backend/module/feedback/feedback.go index 605fca6a7f..9fc7843399 100644 --- a/backend/module/feedback/feedback.go +++ b/backend/module/feedback/feedback.go @@ -103,7 +103,7 @@ func (m *mod) GetSurveys(tx context.Context, req *feedbackv1.GetSurveysRequest) zap.Any("request origins", req.Origins), zap.Any("config origins", m.surveyMap.surveys), ) - return nil, status.Errorf(codes.InvalidArgument, msg) + return nil, status.Errorf(codes.InvalidArgument, "%s", msg) } return &feedbackv1.GetSurveysResponse{ diff --git a/backend/service/chaos/experimentation/terminator/terminator_test.go b/backend/service/chaos/experimentation/terminator/terminator_test.go index fbfb6ef910..ff5952e5af 100644 --- a/backend/service/chaos/experimentation/terminator/terminator_test.go +++ b/backend/service/chaos/experimentation/terminator/terminator_test.go @@ -186,7 +186,7 @@ func awaitGaugeValue(ctx context.Context, t *testing.T, testScope tally.TestScop return } case <-ctx.Done(): - t.Errorf(context.Canceled.Error()) + t.Errorf("%s", context.Canceled.Error()) return } } diff --git a/tools/golangci-lint.sh b/tools/golangci-lint.sh index 78674070a8..437eeda687 100755 --- a/tools/golangci-lint.sh +++ b/tools/golangci-lint.sh @@ -6,9 +6,9 @@ BUILD_ROOT="${REPO_ROOT}/build" BUILD_BIN="${BUILD_ROOT}/bin" NAME=golangci-lint -RELEASE=v1.61.0 -OSX_RELEASE_256=5c280ef3284f80c54fd90d73dc39ca276953949da1db03eb9dd0fbf868cc6e55 -LINUX_RELEASE_256=77cb0af99379d9a21d5dc8c38364d060e864a01bd2f3e30b5e8cc550c3a54111 +RELEASE=v1.60.1 +OSX_RELEASE_256=a0ec2235b5cc7aad6e1ee009efd5bec7c16bf2f01246c6ccb1df5c37bb2f5cd4 +LINUX_RELEASE_256=06a803675ec83944d8c9e5a8dfa32845270cc447e7ebe0173c4b8ba7e205c9da ARCH=amd64