From 9c7547a972a9f11a920eff8ae0817d2abd36d6e0 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 16 Oct 2023 09:42:24 -0300 Subject: [PATCH 1/4] Upgrade to go 1.21.3 --- agentapi/go.mod | 2 +- common/go.mod | 2 +- contractsapi/go.mod | 2 +- end-to-end/go.mod | 2 +- go.work | 2 +- mocks/go.mod | 2 +- storeapi/go-wrapper/microsoftstore/go.mod | 2 +- tools/go.mod | 2 +- windows-agent/go.mod | 2 +- wsl-pro-service/go.mod | 2 +- wslserviceapi/go.mod | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/agentapi/go.mod b/agentapi/go.mod index 68cf9fb90..f4dedac8e 100644 --- a/agentapi/go.mod +++ b/agentapi/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/agentapi -go 1.21.1 +go 1.21.3 require ( google.golang.org/grpc v1.58.3 diff --git a/common/go.mod b/common/go.mod index eba0a7841..c84c20f0e 100644 --- a/common/go.mod +++ b/common/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/common -go 1.21.1 +go 1.21.3 require ( github.com/google/uuid v1.3.1 diff --git a/contractsapi/go.mod b/contractsapi/go.mod index f43341f4d..ed2d3d561 100644 --- a/contractsapi/go.mod +++ b/contractsapi/go.mod @@ -1,3 +1,3 @@ module github.com/canonical/ubuntu-pro-for-windows/contractsapi -go 1.21.1 +go 1.21.3 diff --git a/end-to-end/go.mod b/end-to-end/go.mod index 19681e60b..4f57baf46 100644 --- a/end-to-end/go.mod +++ b/end-to-end/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/end-to-end -go 1.21.1 +go 1.21.3 require ( github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20230906090052-60fb5d60ada4 diff --git a/go.work b/go.work index cc2437030..e2db12a0a 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.21.1 +go 1.21.3 use ( ./agentapi diff --git a/mocks/go.mod b/mocks/go.mod index 758c671e4..c77932a1b 100644 --- a/mocks/go.mod +++ b/mocks/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/mocks -go 1.21.1 +go 1.21.3 require ( github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303 diff --git a/storeapi/go-wrapper/microsoftstore/go.mod b/storeapi/go-wrapper/microsoftstore/go.mod index 11a2ab584..142c01565 100644 --- a/storeapi/go-wrapper/microsoftstore/go.mod +++ b/storeapi/go-wrapper/microsoftstore/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/storeapi/go-wrapper/microsoftstore -go 1.21.1 +go 1.21.3 require ( github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20230905125854-3f98ad6913ab diff --git a/tools/go.mod b/tools/go.mod index e27d13e94..b55452b10 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/tools -go 1.21.1 +go 1.21.3 require ( github.com/canonical/ubuntu-pro-for-windows/windows-agent v0.0.0-20230906090052-60fb5d60ada4 diff --git a/windows-agent/go.mod b/windows-agent/go.mod index 72d505d14..0a08dc10d 100644 --- a/windows-agent/go.mod +++ b/windows-agent/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/windows-agent -go 1.21.1 +go 1.21.3 require ( github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303 diff --git a/wsl-pro-service/go.mod b/wsl-pro-service/go.mod index 831b8cff5..0b129103c 100644 --- a/wsl-pro-service/go.mod +++ b/wsl-pro-service/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/wsl-pro-service -go 1.21.1 +go 1.21.3 require ( github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20231009121516-2b7d721b5cc8 diff --git a/wslserviceapi/go.mod b/wslserviceapi/go.mod index 364da3ab2..91e574dbe 100644 --- a/wslserviceapi/go.mod +++ b/wslserviceapi/go.mod @@ -1,6 +1,6 @@ module github.com/canonical/ubuntu-pro-for-windows/wslserviceapi -go 1.21.1 +go 1.21.3 require ( google.golang.org/grpc v1.58.3 From a00badf3cd0fb243a15a7c209a7728cc5aec7e6c Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 17 Oct 2023 10:17:32 -0300 Subject: [PATCH 2/4] Updates golangci-lint's go version as well --- .golangci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yaml b/.golangci.yaml index bab9f1de8..a10355552 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -67,4 +67,4 @@ linters-settings: staticcheck: # Should be better for it to be autodetected # https://github.com/golangci/golangci-lint/issues/2234 - go: "1.21.1" + go: "1.21.3" From 602fb3e94239dc8890c07ce9b76da3288779f07d Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 17 Oct 2023 13:03:42 -0300 Subject: [PATCH 3/4] Temporarily constrain go version in deb build --- .github/workflows/qa-azure.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/qa-azure.yaml b/.github/workflows/qa-azure.yaml index 8dee67d0b..c0218dc2d 100644 --- a/.github/workflows/qa-azure.yaml +++ b/.github/workflows/qa-azure.yaml @@ -20,6 +20,13 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 + # This step is a workaround because vulnerability checker requires Go 1.21.3 which is not yet available on the archive. + # That requirement only affects test code using mocks, so we don't yet depend on such contracts. + # We should be safe with Go 1.21.1 for a while, until dependencies start to rely on the latest version. + - name: Constrain go version + shell: bash + working-directory: wsl-pro-service + run: go mod edit -go 1.21.1 - name: Build debian package uses: canonical/desktop-engineering/gh-actions/common/build-debian@main with: From 3da1665bfe8ac791f444126d87d3277cf16cf4ff Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 17 Oct 2023 15:07:39 -0300 Subject: [PATCH 4/4] Setup go before running go mod edit This runs on top of ubuntu-latest, which comes with go1.18 That version of go fails to execute "go mod edit -go 1.x.y" It expects the edit to be "-go 1.x" We need go 1.20 or later to do the edit -.- --- .github/workflows/qa-azure.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/qa-azure.yaml b/.github/workflows/qa-azure.yaml index c0218dc2d..aa5055e14 100644 --- a/.github/workflows/qa-azure.yaml +++ b/.github/workflows/qa-azure.yaml @@ -20,9 +20,12 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 - # This step is a workaround because vulnerability checker requires Go 1.21.3 which is not yet available on the archive. + # The following two steps are a workaround because vulnerability checker requires Go 1.21.3 which is not yet available on the archive. # That requirement only affects test code using mocks, so we don't yet depend on such contracts. # We should be safe with Go 1.21.1 for a while, until dependencies start to rely on the latest version. + - uses: actions/setup-go@v4 + with: + go-version-file: go.work - name: Constrain go version shell: bash working-directory: wsl-pro-service