From 7086a8792a87a72f8aa5414d8b6021caf06bf6c1 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Thu, 5 Sep 2024 19:29:29 +0530 Subject: [PATCH] MM-60387: Bump Go version to 1.22 (#28118) https://mattermost.atlassian.net/browse/MM-60387 ```release-note updated Go version to 1.22 ``` --------- Co-authored-by: Mattermost Build --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/migration.yml | 7 ++++++- .github/workflows/mmctl-test-template.yml | 3 ++- .github/workflows/server-test-template.yml | 2 +- server/.go-version | 2 +- server/build/Dockerfile.buildenv | 2 +- server/go.mod | 4 ++-- server/public/go.mod | 4 ++-- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ebcb207fb7..6d98f3d327 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,7 +42,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: '1.21' + go-version: '1.22' if: ${{ matrix.language == 'go' }} diff --git a/.github/workflows/migration.yml b/.github/workflows/migration.yml index 10ff9112a9..b26f547e0a 100644 --- a/.github/workflows/migration.yml +++ b/.github/workflows/migration.yml @@ -7,7 +7,6 @@ jobs: runs-on: ubuntu-22.04 env: COMPOSE_PROJECT_NAME: ghactions - BUILD_IMAGE: mattermost/mattermost-build-server:1.21.8 TEST_IMAGE: migration-test-image defaults: run: @@ -15,6 +14,10 @@ jobs: steps: - name: Checkout mattermost project uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Calculate Golang Version + id: go + working-directory: ./server + run: echo GO_VERSION=$(cat .go-version) >> "${GITHUB_OUTPUT}" - name: Run docker compose run: | cd build @@ -29,6 +32,8 @@ jobs: docker exec ${COMPOSE_PROJECT_NAME}-mysql-1 sh -c "mysql -u root -pmostest -e \"ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'mostest';\"" docker restart ${COMPOSE_PROJECT_NAME}-mysql-1 && sleep 10 - name: Build test image + env: + BUILD_IMAGE: mattermostdevelopment/mattermost-build-server:${{ steps.go.outputs.GO_VERSION }} run: | echo -e "FROM $BUILD_IMAGE\n\nRUN apt update && \ apt remove -y pgloader && \ diff --git a/.github/workflows/mmctl-test-template.yml b/.github/workflows/mmctl-test-template.yml index 7408a9d656..0ec04673a0 100644 --- a/.github/workflows/mmctl-test-template.yml +++ b/.github/workflows/mmctl-test-template.yml @@ -21,7 +21,6 @@ jobs: runs-on: ubuntu-22.04 env: COMPOSE_PROJECT_NAME: ghactions - BUILD_IMAGE: mattermost/mattermost-build-server:1.21.8 steps: - name: Checkout mattermost project uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -50,6 +49,8 @@ jobs: docker compose --ansi never exec -T minio sh -c 'mkdir -p /data/mattermost-test'; docker compose --ansi never ps - name: Run mmctl Tests + env: + BUILD_IMAGE: mattermostdevelopment/mattermost-build-server:${{ steps.go.outputs.GO_VERSION }} run: | if [[ ${{ github.ref_name }} == 'master' ]]; then export TESTFLAGS="-timeout 90m -race" diff --git a/.github/workflows/server-test-template.yml b/.github/workflows/server-test-template.yml index e84ab2a24b..2e46be3f3a 100644 --- a/.github/workflows/server-test-template.yml +++ b/.github/workflows/server-test-template.yml @@ -42,7 +42,7 @@ jobs: docker compose --ansi never ps - name: Run Tests env: - BUILD_IMAGE: mattermost/mattermost-build-server:${{ steps.go.outputs.GO_VERSION }} + BUILD_IMAGE: mattermostdevelopment/mattermost-build-server:${{ steps.go.outputs.GO_VERSION }} run: | if [[ ${{ github.ref_name }} == 'master' ]]; then export RACE_MODE="-race" diff --git a/server/.go-version b/server/.go-version index 428abfd24f..013173af5e 100644 --- a/server/.go-version +++ b/server/.go-version @@ -1 +1 @@ -1.21.8 +1.22.6 diff --git a/server/build/Dockerfile.buildenv b/server/build/Dockerfile.buildenv index 1be19da964..91f7b78507 100644 --- a/server/build/Dockerfile.buildenv +++ b/server/build/Dockerfile.buildenv @@ -1,4 +1,4 @@ -FROM golang:1.21.8-bullseye@sha256:81d98548f08e22a59c5c0be814acc0997f3dfd3313487adcf4e1d3d962af3a43 +FROM golang:1.22.6-bullseye@sha256:0838740c99e64dde1916553b004bdb1bc321823be83bde3d2a1563882eaab7e6 RUN apt-get update && apt-get install -y make git apt-transport-https ca-certificates curl software-properties-common build-essential zip xmlsec1 jq pgloader diff --git a/server/go.mod b/server/go.mod index ddee116d64..8f1a3493f1 100644 --- a/server/go.mod +++ b/server/go.mod @@ -1,8 +1,8 @@ module github.com/mattermost/mattermost/server/v8 -go 1.21.0 +go 1.22.0 -toolchain go1.21.8 +toolchain go1.22.6 require ( code.sajari.com/docconv/v2 v2.0.0-pre.4 diff --git a/server/public/go.mod b/server/public/go.mod index 2973f427d7..df606b13d3 100644 --- a/server/public/go.mod +++ b/server/public/go.mod @@ -1,8 +1,8 @@ module github.com/mattermost/mattermost/server/public -go 1.21 +go 1.22 -toolchain go1.21.8 +toolchain go1.22.6 require ( github.com/blang/semver/v4 v4.0.0