From 524e7cb542c1de5f2ed19bbdc73a9c6e4fafafd0 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Mon, 12 Feb 2024 11:43:08 -0700 Subject: [PATCH 1/5] Update go version to 1.22.0 --- .env | 2 +- CHANGELOG.md | 1 + GO_VERSION | 2 +- go.mod | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 595a033841..10ef3f178b 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ ATS_VERSION=9.1.2 -GO_VERSION=1.21.7 +GO_VERSION=1.22.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1722cd0858..d21bb504e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7614](https://github.com/apache/trafficcontrol/pull/7614) *Traffic Ops* The database upgrade process no longer overwrites changes users may have made to the initially seeded data. - [#7832](https://github.com/apache/trafficcontrol/pull/7832) *t3c* Removed perl dependency - Updated the CacheGroups Traffic Portal page to use a more performant AG-Grid-based table. +- Updated Go version to 1.22.0 ### Fixed - [#7917](https://github.com/apache/trafficcontrol/pull/7917) *Traffic Ops* Removed `Alerts` field from struct `ProfileExportResponse`. diff --git a/GO_VERSION b/GO_VERSION index 8819d012ce..57807d6d0d 100644 --- a/GO_VERSION +++ b/GO_VERSION @@ -1 +1 @@ -1.21.7 +1.22.0 diff --git a/go.mod b/go.mod index 72e2e00cdf..5736265491 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ module github.com/apache/trafficcontrol/v8 // specific language governing permissions and limitations // under the License. -go 1.19 +go 1.22 require ( code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5 From db2b647f09bf749597453260d280d25b54699d4c Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Mon, 12 Feb 2024 11:44:22 -0700 Subject: [PATCH 2/5] Newly-removed vendored files in Go 1.22.0 --- .../migrate/v4/source/iofs/testdata/migrations/1_foobar.down.sql | 1 - .../migrate/v4/source/iofs/testdata/migrations/1_foobar.up.sql | 1 - .../migrate/v4/source/iofs/testdata/migrations/3_foobar.up.sql | 1 - .../migrate/v4/source/iofs/testdata/migrations/4_foobar.down.sql | 1 - .../migrate/v4/source/iofs/testdata/migrations/4_foobar.up.sql | 1 - .../migrate/v4/source/iofs/testdata/migrations/5_foobar.down.sql | 1 - .../migrate/v4/source/iofs/testdata/migrations/7_foobar.down.sql | 1 - .../migrate/v4/source/iofs/testdata/migrations/7_foobar.up.sql | 1 - 8 files changed, 8 deletions(-) delete mode 100644 vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/1_foobar.down.sql delete mode 100644 vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/1_foobar.up.sql delete mode 100644 vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/3_foobar.up.sql delete mode 100644 vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/4_foobar.down.sql delete mode 100644 vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/4_foobar.up.sql delete mode 100644 vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/5_foobar.down.sql delete mode 100644 vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/7_foobar.down.sql delete mode 100644 vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/7_foobar.up.sql diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/1_foobar.down.sql b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/1_foobar.down.sql deleted file mode 100644 index 4267951a5b..0000000000 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/1_foobar.down.sql +++ /dev/null @@ -1 +0,0 @@ -1 down diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/1_foobar.up.sql b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/1_foobar.up.sql deleted file mode 100644 index 046fd5a5dc..0000000000 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/1_foobar.up.sql +++ /dev/null @@ -1 +0,0 @@ -1 up diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/3_foobar.up.sql b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/3_foobar.up.sql deleted file mode 100644 index 77c1b77dcb..0000000000 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/3_foobar.up.sql +++ /dev/null @@ -1 +0,0 @@ -3 up diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/4_foobar.down.sql b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/4_foobar.down.sql deleted file mode 100644 index b405d8bd02..0000000000 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/4_foobar.down.sql +++ /dev/null @@ -1 +0,0 @@ -4 down diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/4_foobar.up.sql b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/4_foobar.up.sql deleted file mode 100644 index eba61bb94e..0000000000 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/4_foobar.up.sql +++ /dev/null @@ -1 +0,0 @@ -4 up diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/5_foobar.down.sql b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/5_foobar.down.sql deleted file mode 100644 index 6dc96e2068..0000000000 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/5_foobar.down.sql +++ /dev/null @@ -1 +0,0 @@ -5 down diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/7_foobar.down.sql b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/7_foobar.down.sql deleted file mode 100644 index 46636016b3..0000000000 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/7_foobar.down.sql +++ /dev/null @@ -1 +0,0 @@ -7 down diff --git a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/7_foobar.up.sql b/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/7_foobar.up.sql deleted file mode 100644 index cdbc410ee9..0000000000 --- a/vendor/github.com/golang-migrate/migrate/v4/source/iofs/testdata/migrations/7_foobar.up.sql +++ /dev/null @@ -1 +0,0 @@ -7 up From ec60ca983d9a59bb286e79d1971b6fad86800adb Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Tue, 13 Feb 2024 00:55:29 -0700 Subject: [PATCH 3/5] The minor Go version must be included in go.mod now --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5736265491..74cc3318ba 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ module github.com/apache/trafficcontrol/v8 // specific language governing permissions and limitations // under the License. -go 1.22 +go 1.22.0 require ( code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5 From 98a841605ec597ba35b3efa7cb3e3ff6e20c6eb2 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Tue, 13 Feb 2024 01:49:29 -0700 Subject: [PATCH 4/5] Fatalf -> Errorf for go vet --- traffic_router/ultimate-test-harness/http_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traffic_router/ultimate-test-harness/http_test.go b/traffic_router/ultimate-test-harness/http_test.go index e19799768a..387d2a9608 100644 --- a/traffic_router/ultimate-test-harness/http_test.go +++ b/traffic_router/ultimate-test-harness/http_test.go @@ -245,7 +245,7 @@ func (b HTTPBenchmark) Run(t *testing.T, redirectsChannel chan int, failuresChan for time.Now().Before(stopTime) { requestURL := trafficRouterURL + paths[rand.Intn(len(paths))] if req, err = http.NewRequest("GET", requestURL, nil); err != nil { - t.Fatalf("creating GET request to Traffic Router '%s' (IP address %s): %s", + t.Errorf("creating GET request to Traffic Router '%s' (IP address %s): %s", trafficRouter.Hostname, trafficRouter.IPAddresses[ipAddressIndex], err.Error()) } req.Header.Set("User-Agent", UserAgent) From fbc01dfb4f2ce9ff8af3a447fdeb7aadc79d18c6 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Tue, 13 Feb 2024 10:13:14 -0700 Subject: [PATCH 5/5] Use repo version of Go fo CodeQL --- .github/workflows/codeql.go.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/codeql.go.yml b/.github/workflows/codeql.go.yml index 7287d28d8f..898aabbe05 100644 --- a/.github/workflows/codeql.go.yml +++ b/.github/workflows/codeql.go.yml @@ -35,6 +35,16 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@master + - name: go-version + run: echo "value=$(cat GO_VERSION)" >> $GITHUB_OUTPUT + id: go-version + - uses: actions/setup-go@v2 + with: + go-version: ${{ steps.go-version.outputs.value }} # The Go version to download (if necessary) and use. + - name: Install modules + run: go mod vendor -v # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL