From 197aa6d1f213489e9a1aa21fc41c10490272fa3a Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Thu, 11 Aug 2022 22:51:52 +0200 Subject: [PATCH] Build min, previous, current and next Go version --- .github/workflows/ci.yml | 22 ++++++++++++++----- .github/workflows/codeql.yml | 4 ++-- .github/workflows/golangci-lint.yml | 4 ++-- .github/workflows/replica-tests.yml | 12 +++++----- Dockerfile.packaging | 2 +- Dockerfile.test | 2 +- README.md | 2 +- RELEASE_VERSION | 1 - doc/command-line-flags.md | 8 +++++++ go.mod | 5 ++--- go.sum | 6 ----- go/base/load_map.go | 3 ++- .../fail-datetime-with-zero/ignore_versions | 1 - script/ensure-go-installed | 8 +++---- vendor/modules.txt | 2 -- 15 files changed, 46 insertions(+), 36 deletions(-) delete mode 100644 RELEASE_VERSION delete mode 100644 localtests/fail-datetime-with-zero/ignore_versions diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d5a07bce..eb3a740d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,25 +1,35 @@ name: CI -on: [pull_request] +on: + pull_request: jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + version: + - 1.16 # minimum + - 1.17 # previous + - 1.18 # current + - 1.19 # next steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v1 + id: setup-go + uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: ${{ matrix.version }} - name: Build run: script/cibuild + # only upload binary artifact for current version - name: Upload gh-ost binary artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 + if: ${{ contains(steps.setup-go.outputs.go-version, '1.18') }} with: name: gh-ost path: bin/gh-ost diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index abce58a3b..7d9d6db85 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -16,9 +16,9 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Initialize CodeQL + - name: Initialize CodeQL uses: github/codeql-action/init@v1 - name: Perform CodeQL Analysis diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 07fa01d89..7e5aa3ac9 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -13,10 +13,10 @@ jobs: name: lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.17 - - uses: actions/checkout@v3 + go-version-file: go.mod - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.github/workflows/replica-tests.yml b/.github/workflows/replica-tests.yml index e28c2bc3a..aa28630c1 100644 --- a/.github/workflows/replica-tests.yml +++ b/.github/workflows/replica-tests.yml @@ -8,17 +8,19 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [mysql-5.7.25,mysql-8.0.16] + version: + - mysql-5.7.25 + - mysql-8.0.16 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version-file: go.mod - name: migration tests env: TEST_MYSQL_VERSION: ${{ matrix.version }} - run: script/cibuild-gh-ost-replica-tests + run: script/cibuild-gh-ost-replica-tests diff --git a/Dockerfile.packaging b/Dockerfile.packaging index be321fa8d..92024a88e 100644 --- a/Dockerfile.packaging +++ b/Dockerfile.packaging @@ -1,4 +1,4 @@ -FROM golang:1.17 +FROM golang:1.18 RUN apt-get update RUN apt-get install -y ruby ruby-dev rubygems build-essential diff --git a/Dockerfile.test b/Dockerfile.test index e9155763c..fd5ce2930 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,4 +1,4 @@ -FROM golang:1.17 +FROM golang:1.18 LABEL maintainer="github@github.com" RUN apt-get update diff --git a/README.md b/README.md index e21344dcd..b876088ff 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Please see [Coding gh-ost](doc/coding-ghost.md) for a guide to getting started d [Download latest release here](https://github.com/github/gh-ost/releases/latest) -`gh-ost` is a Go project; it is built with Go `1.15` and above. To build on your own, use either: +`gh-ost` is a Go project; it is built with Go `1.16` and above. To build on your own, use either: - [script/build](https://github.com/github/gh-ost/blob/master/script/build) - this is the same build script used by CI hence the authoritative; artifact is `./bin/gh-ost` binary. - [build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost` diff --git a/RELEASE_VERSION b/RELEASE_VERSION deleted file mode 100644 index 45a1b3f44..000000000 --- a/RELEASE_VERSION +++ /dev/null @@ -1 +0,0 @@ -1.1.2 diff --git a/doc/command-line-flags.md b/doc/command-line-flags.md index c689dfd96..dc481d0f0 100644 --- a/doc/command-line-flags.md +++ b/doc/command-line-flags.md @@ -246,6 +246,14 @@ Provide a command delimited list of replicas; `gh-ost` will throttle when any of Provide an HTTP endpoint; `gh-ost` will issue `HEAD` requests on given URL and throttle whenever response status code is not `200`. The URL can be queried and updated dynamically via [interactive commands](interactive-commands.md). Empty URL disables the HTTP check. +### throttle-http-interval-millis + +Defaults to 100. Configures the HTTP throttle check interval in milliseconds. + +### throttle-http-timeout-millis + +Defaults to 1000 (1 second). Configures the HTTP throttler check timeout in milliseconds. + ### timestamp-old-table Makes the _old_ table include a timestamp value. The _old_ table is what the original table is renamed to at the end of a successful migration. For example, if the table is `gh_ost_test`, then the _old_ table would normally be `_gh_ost_test_del`. With `--timestamp-old-table` it would be, for example, `_gh_ost_test_20170221103147_del`. diff --git a/go.mod b/go.mod index 885d97eeb..dbfb22003 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/github/gh-ost -go 1.17 +go 1.18 require ( github.com/go-ini/ini v1.62.0 @@ -8,8 +8,8 @@ require ( github.com/go-sql-driver/mysql v1.6.0 github.com/openark/golib v0.0.0-20210531070646-355f37940af8 github.com/satori/go.uuid v1.2.0 - golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 + golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 golang.org/x/text v0.3.6 ) @@ -21,7 +21,6 @@ require ( github.com/smartystreets/goconvey v1.6.4 // indirect go.uber.org/atomic v1.7.0 // indirect golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect - golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.62.0 // indirect ) diff --git a/go.sum b/go.sum index 6b44084a0..4ba00f124 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -96,14 +94,10 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/go/base/load_map.go b/go/base/load_map.go index 2a07b7f5f..cfe92154b 100644 --- a/go/base/load_map.go +++ b/go/base/load_map.go @@ -23,7 +23,8 @@ func NewLoadMap() LoadMap { // NewLoadMap parses a `--*-load` flag (e.g. `--max-load`), which is in multiple // key-value format, such as: -// 'Threads_running=100,Threads_connected=500' +// +// 'Threads_running=100,Threads_connected=500' func ParseLoadMap(loadList string) (LoadMap, error) { result := NewLoadMap() if loadList == "" { diff --git a/localtests/fail-datetime-with-zero/ignore_versions b/localtests/fail-datetime-with-zero/ignore_versions deleted file mode 100644 index b6de5f8d9..000000000 --- a/localtests/fail-datetime-with-zero/ignore_versions +++ /dev/null @@ -1 +0,0 @@ -(5.5|5.6) diff --git a/script/ensure-go-installed b/script/ensure-go-installed index 3d33ae4e1..a39998c13 100755 --- a/script/ensure-go-installed +++ b/script/ensure-go-installed @@ -1,13 +1,13 @@ #!/bin/bash -PREFERRED_GO_VERSION=go1.17.11 -SUPPORTED_GO_VERSIONS='go1.1[567]' +PREFERRED_GO_VERSION=go1.18.5 +SUPPORTED_GO_VERSIONS='go1.1[6789]' GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg -GO_PKG_DARWIN_SHA=4f924c534230de8f0e1c7369f611c0310efd21fc2d9438b13bc2703af9dda25a +GO_PKG_DARWIN_SHA=7a27dbe31c9fdd98be83ed6ce76fa5474044a2d960e2f9db8fa92b256dda2e58 GO_PKG_LINUX=${PREFERRED_GO_VERSION}.linux-amd64.tar.gz -GO_PKG_LINUX_SHA=d69a4fe2694f795d8e525c72b497ededc209cb7185f4c3b62d7a98dd6227b3fe +GO_PKG_LINUX_SHA=9e5de37f9c49942c601b191ac5fba404b868bfc21d446d6960acc12283d6e5f2 export ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" cd $ROOTDIR diff --git a/vendor/modules.txt b/vendor/modules.txt index 6f7639b77..1ca88fdb5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -37,8 +37,6 @@ github.com/siddontang/go-log/loggers # go.uber.org/atomic v1.7.0 ## explicit; go 1.13 go.uber.org/atomic -# golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 -## explicit; go 1.11 # golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 ## explicit; go 1.11 golang.org/x/net/context