From f76d240495bfb4fed29b17cdfcca50ca4a2db846 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Mon, 23 Jan 2023 12:43:56 +0530 Subject: [PATCH] MM-49703: Bump Go version to 1.19 (#22107) https://mattermost.atlassian.net/browse/MM-49703 Co-authored-by: Mattermost Build --- .circleci/config.yml | 14 +++++++------- .golangci.yml | 3 --- Makefile | 2 +- build/Dockerfile.buildenv | 2 +- go.mod | 2 +- scripts/setup_go_work.sh | 4 ++-- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c53ed45a72..0d5e2ef3f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -212,7 +212,7 @@ jobs: check-golangci-lint: docker: # Keep the version in sync with the command in Makefile - - image: golangci/golangci-lint:v1.46.2 + - image: golangci/golangci-lint:v1.50.1 resource_class: xlarge working_directory: /mnt/ramdisk steps: @@ -226,7 +226,7 @@ jobs: # Dedicate job for mattermost-vet to make more clear when the job fails check-mattermost-vet: docker: - - image: mattermost/mattermost-build-server:20220415_golang-1.18.1 + - image: mattermost/mattermost-build-server:20230118_golang-1.19.5 resource_class: xlarge working_directory: /mnt/ramdisk steps: @@ -256,7 +256,7 @@ jobs: make build build-focalboard: docker: - - image: mattermost/mattermost-build-server:20220415_golang-1.18.1 + - image: mattermost/mattermost-build-server:20230118_golang-1.19.5 resource_class: medium working_directory: /mnt/ramdisk steps: @@ -268,7 +268,7 @@ jobs: make server-linux build-mattermost-server: docker: - - image: mattermost/mattermost-build-server:20220415_golang-1.18.1 + - image: mattermost/mattermost-build-server:20230118_golang-1.19.5 resource_class: xlarge working_directory: /mnt/ramdisk steps: @@ -384,7 +384,7 @@ jobs: --env CIRCLECI=true \ -v ~/mattermost:/mattermost \ -w /mattermost/mattermost-server \ - mattermost/mattermost-build-server:20220415_golang-1.18.1 \ + mattermost/mattermost-build-server:20230118_golang-1.19.5 \ bash -c "ulimit -n 8096; make test-server<< parameters.racemode >> BUILD_NUMBER=$CIRCLE_BRANCH-$CIRCLE_PREVIOUS_BUILD_NUM TESTFLAGS= TESTFLAGSEE=" \ bash -c scripts/diff-email-templates.sh no_output_timeout: 2h @@ -449,7 +449,7 @@ jobs: --env MM_SQLSETTINGS_DRIVERNAME=postgres \ -v ~/mattermost:/mattermost \ -w /mattermost/mattermost-server \ - mattermost/mattermost-build-server:20220415_golang-1.18.1 \ + mattermost/mattermost-build-server:20230118_golang-1.19.5 \ bash -c "ulimit -n 8096; make ARGS='db migrate' run-cli && make MM_SQLSETTINGS_DATASOURCE='postgres://mmuser:mostest@postgres:5432/latest?sslmode=disable&connect_timeout=10' ARGS='db migrate' run-cli" echo "Generating dump" docker-compose --no-ansi exec -T postgres pg_dump --schema-only -d migrated -U mmuser > migrated.sql @@ -475,7 +475,7 @@ jobs: --env MM_SQLSETTINGS_DRIVERNAME=mysql \ -v ~/mattermost:/mattermost \ -w /mattermost/mattermost-server \ - mattermost/mattermost-build-server:20220415_golang-1.18.1 \ + mattermost/mattermost-build-server:20230118_golang-1.19.5 \ bash -c "ulimit -n 8096; make ARGS='db migrate' run-cli && make MM_SQLSETTINGS_DATASOURCE='mmuser:mostest@tcp(mysql:3306)/latest?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s' ARGS='db migrate' run-cli" echo "Generating dump" docker-compose --no-ansi exec -T mysql mysqldump --skip-opt --no-data --compact -u root -pmostest migrated > migrated.sql diff --git a/.golangci.yml b/.golangci.yml index 39ebcc389b..e9d2d1f210 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,18 +15,15 @@ linters-settings: linters: disable-all: true enable: - - deadcode - gofmt - golint - gosimple - govet - ineffassign - exportloopref - - structcheck - staticcheck - unconvert - unused - - varcheck - misspell - goimports # TODO: enable this later diff --git a/Makefile b/Makefile index 3f3477094e..263d4fdc2d 100644 --- a/Makefile +++ b/Makefile @@ -312,7 +312,7 @@ endif golangci-lint: ## Run golangci-lint on codebase @# Keep the version in sync with the command in .circleci/config.yml - $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2 + $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1 @echo Running golangci-lint $(GOBIN)/golangci-lint run ./... diff --git a/build/Dockerfile.buildenv b/build/Dockerfile.buildenv index 6b9bf14425..beeb1291ef 100644 --- a/build/Dockerfile.buildenv +++ b/build/Dockerfile.buildenv @@ -1,3 +1,3 @@ -FROM golang:1.18.1@sha256:ee752bc53c628ff789bacefb714cff721701042ffa9eb736f7b2ed4e9f2bdab6 +FROM golang:1.19.5@sha256:bb9811fad43a7d6fd2173248d8331b2dcf5ac9af20976b1937ecd214c5b8c383 RUN apt-get update && apt-get install -y make git apt-transport-https ca-certificates curl software-properties-common build-essential zip xmlsec1 jq diff --git a/go.mod b/go.mod index 7a5550ac0b..870a591218 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/mattermost/mattermost-server/v6 -go 1.18 +go 1.19 require ( code.sajari.com/docconv v1.3.5 diff --git a/scripts/setup_go_work.sh b/scripts/setup_go_work.sh index 76c7018736..d6aa060883 100755 --- a/scripts/setup_go_work.sh +++ b/scripts/setup_go_work.sh @@ -4,7 +4,7 @@ if [[ $1 != "true" ]] ; then echo "Creating a go.work file" - txt="go 1.18\n\nuse ./\n" + txt="go 1.19\n\nuse ./\n" if [ "$BUILD_ENTERPRISE_READY" == "true" ] then @@ -17,4 +17,4 @@ then fi printf "$txt" > "go.work" -fi \ No newline at end of file +fi