From 69950217f54b15d64dadf4586f751ab6fdb572bf Mon Sep 17 00:00:00 2001 From: Alex Johnson Date: Wed, 21 Sep 2022 11:56:06 -0400 Subject: [PATCH] chore: tooling updates (#2847) --- .github/workflows/gen-docs-cli.yml | 4 ++-- .github/workflows/go-formatting.yml | 2 +- .github/workflows/release-binary.yml | 4 ++-- .github/workflows/release-nightly.yml | 2 +- .github/workflows/test-integration.yml | 4 ++-- .github/workflows/test-lint.yml | 6 +++--- .github/workflows/test.yml | 4 ++-- .golangci.yml | 3 +-- Makefile | 7 ++++++- go.mod | 3 ++- go.sum | 8 +++++++- ignite/internal/tools/tools.go | 1 + ignite/services/network/join_test.go | 4 ++-- 13 files changed, 32 insertions(+), 20 deletions(-) diff --git a/.github/workflows/gen-docs-cli.yml b/.github/workflows/gen-docs-cli.yml index 33772c34cd..1c6844244f 100644 --- a/.github/workflows/gen-docs-cli.yml +++ b/.github/workflows/gen-docs-cli.yml @@ -11,9 +11,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Generate CLI Docs run: ./scripts/gen-cli-docs diff --git a/.github/workflows/go-formatting.yml b/.github/workflows/go-formatting.yml index 5bfd056765..f1bdb9ac57 100644 --- a/.github/workflows/go-formatting.yml +++ b/.github/workflows/go-formatting.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: '1.18' + go-version: 1.19 - name: Run make format run: make format diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index 80e5944dfa..c5091496a4 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -12,9 +12,9 @@ jobs: steps: - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 1b76bd56d6..be6c346772 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -46,7 +46,7 @@ jobs: prerelease: true - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.18 diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 5ae70e2cae..1f71fd88bf 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -45,10 +45,10 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 if: env.GIT_DIFF with: - go-version: 1.18 + go-version: 1.19 - name: Install Ignite CLI if: env.GIT_DIFF run: go install ./... diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index aac82f8f6e..afeda0dd60 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -21,14 +21,14 @@ jobs: go.mod go.sum - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 if: env.GIT_DIFF with: - go-version: 1.18 + go-version: 1.19 - uses: golangci/golangci-lint-action@master if: env.GIT_DIFF with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.45.2 + version: v1.49.0 args: --timeout 10m github-token: ${{ secrets.github_token }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c169783411..32343aac95 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,9 +18,9 @@ jobs: PATTERNS: | **/* !**/*.md - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 if: env.GIT_DIFF with: - go-version: 1.18 + go-version: 1.19 - run: ./scripts/test-unit if: env.GIT_DIFF diff --git a/.golangci.yml b/.golangci.yml index fc318c3a90..887ed72ff7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,8 +14,7 @@ linters: # - errcheck - goconst - gocritic - - gofmt - - goimports + - gofumpt - revive # - gosec - gosimple diff --git a/Makefile b/Makefile index dc6f4a15d6..f069f2c7a0 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,11 @@ govet: @echo Running go vet... @go vet ./... +## govulncheck: Run govulncheck +govulncheck: + @echo Running govulncheck... + @go run golang.org/x/vuln/cmd/govulncheck ./... + ## format: Install and run goimports and gofumpt format: @echo Formatting... @@ -65,7 +70,7 @@ test-integration: install @go test -race -failfast -v -timeout 60m ./integration/... ## test: Run unit and integration tests. -test: govet test-unit test-integration +test: govet govulncheck test-unit test-integration .PHONY: test-unit test-integration test diff --git a/go.mod b/go.mod index ca009427b2..13bf20aad8 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,8 @@ require ( golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 golang.org/x/text v0.3.7 - golang.org/x/tools v0.1.12 + golang.org/x/tools v0.1.13-0.20220803210227-8b9a1fbdf5c3 + golang.org/x/vuln v0.0.0-20220919155316-41b1fc70d0a6 google.golang.org/grpc v1.49.0 google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 4ffff42fd8..772f575f41 100644 --- a/go.sum +++ b/go.sum @@ -327,6 +327,7 @@ github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2u github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -847,6 +848,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmdtest v0.4.0 h1:ToXh6W5spLp3npJV92tk6d5hIpUPYEzHLkD+rncbyhI= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -887,6 +889,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -2271,8 +2274,11 @@ golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlz golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.1.13-0.20220803210227-8b9a1fbdf5c3 h1:aE4T3aJwdCNz+s35ScSQYUzeGu7BOLDHZ1bBHVurqqY= +golang.org/x/tools v0.1.13-0.20220803210227-8b9a1fbdf5c3/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/vuln v0.0.0-20220919155316-41b1fc70d0a6 h1:tQFrcJZ95V1wiLLPoAIaEuEVXJ7JkhbZI4Hws7Fx69c= +golang.org/x/vuln v0.0.0-20220919155316-41b1fc70d0a6/go.mod h1:7tDfEDtOLlzHQRi4Yzfg5seVBSvouUIjyPzBx4q5CxQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/ignite/internal/tools/tools.go b/ignite/internal/tools/tools.go index 3e5736ce8d..9a4a8047e3 100644 --- a/ignite/internal/tools/tools.go +++ b/ignite/internal/tools/tools.go @@ -7,5 +7,6 @@ import ( _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/vektra/mockery/v2" _ "golang.org/x/tools/cmd/goimports" + _ "golang.org/x/vuln/cmd/govulncheck" _ "mvdan.cc/gofumpt" ) diff --git a/ignite/services/network/join_test.go b/ignite/services/network/join_test.go index d2780c8e83..a4db707e54 100644 --- a/ignite/services/network/join_test.go +++ b/ignite/services/network/join_test.go @@ -54,8 +54,8 @@ func TestJoin(t *testing.T) { []byte{}, sdk.NewCoin(TestDenom, sdkmath.NewInt(TestAmountInt)), launchtypes.Peer{ - testutil.NodeID, - &launchtypes.Peer_TcpAddress{ + Id: testutil.NodeID, + Connection: &launchtypes.Peer_TcpAddress{ TcpAddress: testutil.TCPAddress, }, }),