From 9bd4d342eb4c4464c300c7f3ce8623b5d3ff217f Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Thu, 13 Jul 2023 15:54:24 -0500 Subject: [PATCH] Backport of [NET-4895] ci - api tests and consul container tests error because of dependency bugs with go 1.20.6. Pin go to 1.20.5. into release/1.15.x (#18127) ## Backport This PR is auto-generated from #18124 to be assessed for backporting due to the inclusion of the label backport/1.15. :rotating_light: >**Warning** automatic cherry-pick of commits failed. If the first commit failed, you will see a blank no-op commit below. If at least one commit succeeded, you will see the cherry-picked commits up to, _not including_, the commit where the merge conflict occurred. The person who merged in the original PR is: @jmurret This person should manually cherry-pick the original PR into a new backport PR, and close this one when the manual backport PR is merged in. > merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict [] The below text is copied from the body of the original PR. --- ### Description The following jobs started failing when go 1.20.6 was released: - `go-test-api-1-19` - `go-test-api-1-20` - `compatibility-integration-tests` - `upgrade-integration-tests` `compatibility-integration-tests` and `compatibility-integration-tests` to this testcontainers issue: https://github.com/testcontainers/testcontainers-go/issues/1359. This issue calls for testcontainers to release a new version when one of their dependencies is fixed. When that is done, we will unpin the go versions in `compatibility-integration-tests` and `compatibility-integration-tests`. ### Testing & Reproduction steps See these jobs broken in CI and then see them work with this PR. ---
Overview of commits - 747195f7aaf291305681bb7d8ae070761a2aef55 - 516492420bf43427f1cf89adce4d4e222bbb5aaa - f4d6ca19f8e543048e167b9c47528eeb0bdb656f - a47407115e086bb5eff6b34a08839989534b505f - 8c03b36e00719b65a87d277012dea2ac08b67442 - c50b17c46ec64dfea20f61d242e1998c804eb8f7 - 7b55f66218e3a17a0c609a1d85d45f6d1a1e6961 - 93ce5fcc61fe0292f4e0cba98c7101fbe5142139
--------- Co-authored-by: temp Co-authored-by: John Murret Co-authored-by: Chris Thain <32781396+cthain@users.noreply.github.com> --- .github/workflows/go-tests.yml | 8 ++++++++ .github/workflows/reusable-unit.yml | 12 +++++++++++- .github/workflows/test-integrations.yml | 12 ++++++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 9baf90c505ed..be773c2b0e06 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.10" 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 @@ -412,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 diff --git a/.github/workflows/reusable-unit.yml b/.github/workflows/reusable-unit.yml index 403440ad2f7d..c49a6291fa2e 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 @@ -57,7 +61,13 @@ jobs: - name: Setup Git 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@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + if: ${{ inputs.go-version != '' }} + with: + go-version: ${{ 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 diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index cd93ec083de1..db45145bd5f8 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -367,7 +367,11 @@ jobs: - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 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: | @@ -471,7 +475,11 @@ jobs: - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 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