From 747195f7aaf291305681bb7d8ae070761a2aef55 Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 13 Jul 2023 11:41:46 -0600 Subject: [PATCH 1/7] see if go 1.26.4 fails in ci for compatibility and upgrade tests --- .github/workflows/test-integrations.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 263a2e41e4ae..1042785ddd58 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -370,6 +370,7 @@ jobs: - name: Setup Git if: ${{ endsWith(github.repository, '-enterprise') }} run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" + # checking to see if 1.26.4 fails - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version-file: 'go.mod' @@ -485,6 +486,7 @@ jobs: - name: Setup Git if: ${{ endsWith(github.repository, '-enterprise') }} run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" + # checking to see if 1.26.4 fails - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version-file: 'go.mod' From 516492420bf43427f1cf89adce4d4e222bbb5aaa Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 13 Jul 2023 12:12:32 -0600 Subject: [PATCH 2/7] pin CI for compatibility and upgrade tests to go version 1.20.5 as 1.20.6 introduces an invalid host header error --- .github/workflows/test-integrations.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 1042785ddd58..1a3876855d5e 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -370,10 +370,13 @@ jobs: - name: Setup Git if: ${{ endsWith(github.repository, '-enterprise') }} run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" - # checking to see if 1.26.4 fails - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: - go-version-file: 'go.mod' + # pinning this to 1.20.5 because this issue in go-testcontainers occurs + # in 1.20.6 with the error "http: invalid Host header, host port waiting failed" + # https://github.com/testcontainers/testcontainers-go/issues/1359 + # go-version-file: 'go.mod' + go-version: '1.20.5' - run: go env - name: docker env run: | @@ -486,10 +489,13 @@ jobs: - name: Setup Git if: ${{ endsWith(github.repository, '-enterprise') }} run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" - # checking to see if 1.26.4 fails - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: - go-version-file: 'go.mod' + # pinning this to 1.20.5 because this issue in go-testcontainers occurs + # in 1.20.6 with the error "http: invalid Host header, host port waiting failed" + # https://github.com/testcontainers/testcontainers-go/issues/1359 + # go-version-file: 'go.mod' + go-version: '1.20.5' - run: go env # Get go binary from workspace From f4d6ca19f8e543048e167b9c47528eeb0bdb656f Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 13 Jul 2023 12:19:02 -0600 Subject: [PATCH 3/7] allow optionally specifying a specific go-version when using reusable-unit.yml. pin the 1.20 api tests to use 1.20.5 --- .github/workflows/go-tests.yml | 7 +++++++ .github/workflows/reusable-unit.yml | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 9baf90c505ed..4a166401d51d 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -376,6 +376,7 @@ jobs: runs-on: ${{ needs.setup.outputs.compute-xl }} repository-name: ${{ github.repository }} go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}" + go-version: "1.19" permissions: id-token: write # NOTE: this permission is explicitly required for Vault auth. contents: read @@ -394,6 +395,12 @@ jobs: runs-on: ${{ needs.setup.outputs.compute-xl }} repository-name: ${{ github.repository }} go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}" + # pinning this to 1.20.5 because this issue in go-testcontainers occurs + # in 1.20.6 with the error "http: invalid Host header, host port waiting failed" + # https://github.com/testcontainers/testcontainers-go/issues/1359 + # remove setting this when the above issue is fixed so that the reusable + # job will just get the go version from go.mod. + go-version: "1.20.5" permissions: id-token: write # NOTE: this permission is explicitly required for Vault auth. contents: read diff --git a/.github/workflows/reusable-unit.yml b/.github/workflows/reusable-unit.yml index c066cad3f48d..2c05477398f8 100644 --- a/.github/workflows/reusable-unit.yml +++ b/.github/workflows/reusable-unit.yml @@ -33,6 +33,10 @@ on: required: false type: string default: "" + go-version: + required: false + type: string + default: "" secrets: elevated-github-token: required: true @@ -59,6 +63,12 @@ jobs: if: ${{ endsWith(inputs.repository-name, '-enterprise') }} run: git config --global url."https://${{ secrets.elevated-github-token }}:@github.com".insteadOf "https://github.com" - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + if: ${{ inputs.go-version != "" }} + with: + go-version-file: ${{ inputs.go-version }} + cache: true + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + if: ${{ inputs.go-version == "" }} with: go-version-file: 'go.mod' cache: true From a47407115e086bb5eff6b34a08839989534b505f Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 13 Jul 2023 12:26:42 -0600 Subject: [PATCH 4/7] updating if logic on steps so they can be parsed. --- .github/workflows/reusable-unit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-unit.yml b/.github/workflows/reusable-unit.yml index 2c05477398f8..ec8562dd70dd 100644 --- a/.github/workflows/reusable-unit.yml +++ b/.github/workflows/reusable-unit.yml @@ -63,12 +63,12 @@ jobs: if: ${{ endsWith(inputs.repository-name, '-enterprise') }} run: git config --global url."https://${{ secrets.elevated-github-token }}:@github.com".insteadOf "https://github.com" - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 - if: ${{ inputs.go-version != "" }} + if: ${{ inputs.go-version != '' }} with: go-version-file: ${{ inputs.go-version }} cache: true - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 - if: ${{ inputs.go-version == "" }} + if: ${{ inputs.go-version == '' }} with: go-version-file: 'go.mod' cache: true From 8c03b36e00719b65a87d277012dea2ac08b67442 Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 13 Jul 2023 12:28:09 -0600 Subject: [PATCH 5/7] fix go-tests-1.19 to actually pass 1.19 as the version. previously was just testing 1.20 --- .github/workflows/go-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 4a166401d51d..667e7fb331a9 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -419,6 +419,7 @@ jobs: runs-on: ${{ needs.setup.outputs.compute-xl }} repository-name: ${{ github.repository }} go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}" + go-version: "1.19" permissions: id-token: write # NOTE: this permission is explicitly required for Vault auth. contents: read From c50b17c46ec64dfea20f61d242e1998c804eb8f7 Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 13 Jul 2023 12:30:27 -0600 Subject: [PATCH 6/7] fix reusable unit to specify go-version rather than go-version-file when the go-version input is supplied. --- .github/workflows/reusable-unit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-unit.yml b/.github/workflows/reusable-unit.yml index ec8562dd70dd..7442b06c33b5 100644 --- a/.github/workflows/reusable-unit.yml +++ b/.github/workflows/reusable-unit.yml @@ -65,7 +65,7 @@ jobs: - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 if: ${{ inputs.go-version != '' }} with: - go-version-file: ${{ inputs.go-version }} + go-version: ${{ inputs.go-version }} cache: true - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 if: ${{ inputs.go-version == '' }} From 7b55f66218e3a17a0c609a1d85d45f6d1a1e6961 Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 13 Jul 2023 13:06:26 -0600 Subject: [PATCH 7/7] Update .github/workflows/go-tests.yml Co-authored-by: Chris Thain <32781396+cthain@users.noreply.github.com> --- .github/workflows/go-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 667e7fb331a9..be773c2b0e06 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -376,7 +376,7 @@ jobs: runs-on: ${{ needs.setup.outputs.compute-xl }} repository-name: ${{ github.repository }} go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consulprem consuldev' || '' }}" - go-version: "1.19" + go-version: "1.19.10" permissions: id-token: write # NOTE: this permission is explicitly required for Vault auth. contents: read