From bd27b2999c8d6d007fad84dbd6e4398aa344bf6d Mon Sep 17 00:00:00 2001 From: achettyiitr Date: Mon, 26 Feb 2024 14:20:47 +0530 Subject: [PATCH] chore: upgrade dependencies --- .github/dependabot.yml | 10 ++++++++- .github/workflows/semantic-pr.yaml | 2 +- .github/workflows/tests.yaml | 9 ++++---- .github/workflows/verify.yml | 20 +++++++++++------- .golangci.yml | 2 +- Makefile | 4 ++-- compose/compose.go | 6 +----- compose/testdata/docker-compose.test.yml | 3 ++- go.mod | 14 +++++++------ go.sum | 26 +++++++++++++++--------- scripts/install-golangci-lint.sh | 7 +++++++ 11 files changed, 64 insertions(+), 39 deletions(-) create mode 100755 scripts/install-golangci-lint.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 14030fd..70e7af4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,14 @@ version: 2 updates: - package-ecosystem: "gomod" - directory: "/" # Location of package manifests + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "docker" + directory: "/" schedule: interval: "daily" diff --git a/.github/workflows/semantic-pr.yaml b/.github/workflows/semantic-pr.yaml index f716a05..cf08630 100644 --- a/.github/workflows/semantic-pr.yaml +++ b/.github/workflows/semantic-pr.yaml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v4 + uses: amannn/action-semantic-pull-request@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index de614a3..1748ec2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,17 +10,16 @@ jobs: name: Test strategy: matrix: - go-version: [1.19.x, 1.20.x] + go-version: [1.21.x, 1.22.x] os: [ubuntu-latest] - # os: [ubuntu-latest, macos-latest, windows-latest] <- missing docker runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: # In order: # * Module download cache diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 0a32b5b..a6bff5a 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -12,11 +12,12 @@ jobs: name: Correct generated files runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: '1.19.x' - - uses: actions/cache@v2 + go-version: '~1.21' + check-latest: true + - uses: actions/cache@v4 with: path: | ~/.cache/go-build @@ -41,8 +42,13 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '~1.21' + check-latest: true - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: - version: v1.52.2 + version: v1.55.2 + args: -v \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 2984c64..102372c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ run: timeout: 2m - go: '1.19' + go: '1.21' linters: enable: diff --git a/Makefile b/Makefile index 9335929..6b3ecdb 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,11 @@ help: ## Show the available commands install-tools: go install mvdan.cc/gofumpt@latest go install golang.org/x/vuln/cmd/govulncheck@latest + bash ./scripts/install-golangci-lint.sh v1.55.2 .PHONY: lint lint: fmt - docker run --rm -v $(shell pwd):/app:ro -w /app golangci/golangci-lint:v1.52.2 bash -e -c \ - 'golangci-lint run -v --timeout 5m' + golangci-lint run -v --timeout 5m .PHONY: fmt fmt: install-tools diff --git a/compose/compose.go b/compose/compose.go index 1c77361..6d69863 100644 --- a/compose/compose.go +++ b/compose/compose.go @@ -12,16 +12,12 @@ import ( "time" ) -func init() { - rand.Seed(time.Now().UnixNano()) -} - var letters = []rune("abcdefghijklmnopqrstuvwxyz") func randSeq(n int) string { b := make([]rune, n) for i := range b { - b[i] = letters[rand.Intn(len(letters))] + b[i] = letters[rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(letters))] } return string(b) } diff --git a/compose/testdata/docker-compose.test.yml b/compose/testdata/docker-compose.test.yml index cac2aad..801dcda 100644 --- a/compose/testdata/docker-compose.test.yml +++ b/compose/testdata/docker-compose.test.yml @@ -26,9 +26,10 @@ services: environment: - MINIO_ACCESS_KEY=MYACCESSKEY - MINIO_SECRET_KEY=MYSECRETKEY + - MINIO_SITE_REGION=us-east-1 command: server /data healthcheck: - test: curl --fail http://localhost:9000/minio/health/live || exit 1 + test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1 interval: 1s retries: 25 zookeeper: diff --git a/go.mod b/go.mod index 0a4e845..32407e7 100644 --- a/go.mod +++ b/go.mod @@ -1,20 +1,22 @@ module github.com/rudderlabs/compose-test -go 1.19 +go 1.21 + +toolchain go1.21.3 require ( - github.com/jackc/pgx/v5 v5.4.3 + github.com/jackc/pgx/v5 v5.5.3 github.com/stretchr/testify v1.8.4 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/text v0.9.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + golang.org/x/crypto v0.20.0 // indirect + golang.org/x/text v0.14.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5b862e2..f8a516f 100644 --- a/go.sum +++ b/go.sum @@ -4,28 +4,34 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.4.3 h1:cxFyXhxlvAifxnkKKdlxv8XqUf59tDlYjnV5YYfsJJY= -github.com/jackc/pgx/v5 v5.4.3/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.5.3 h1:Ces6/M3wbDXYpM8JyyPD57ivTtJACFZJd885pdIaV2s= +github.com/jackc/pgx/v5 v5.5.3/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/scripts/install-golangci-lint.sh b/scripts/install-golangci-lint.sh new file mode 100755 index 0000000..c5bc445 --- /dev/null +++ b/scripts/install-golangci-lint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +VERSION=$1 +[ -z "${VERSION}" ] && VERSION="v1.55.2" +GOPATH=$(go env GOPATH) +[ -f "${GOPATH}/bin/golangci-lint-${VERSION}" ] && echo "golangci-lint ${VERSION} is already installed" || \ +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/${VERSION}/install.sh | sh -s -- -b "${GOPATH}"/bin ${VERSION} && \ +cp "${GOPATH}"/bin/golangci-lint "${GOPATH}"/bin/golangci-lint-${VERSION}