Skip to content

🌱 Update golangci-lint to latest#176

Closed
furkatgofurov7 wants to merge 1 commit into
metal3-io:masterfrom
Nordix:bump-golangci-lint/furkat
Closed

🌱 Update golangci-lint to latest#176
furkatgofurov7 wants to merge 1 commit into
metal3-io:masterfrom
Nordix:bump-golangci-lint/furkat

Conversation

@furkatgofurov7
Copy link
Copy Markdown
Member

@furkatgofurov7 furkatgofurov7 commented Mar 2, 2021

What this PR does / why we need it:
Golangci-lint is failing intermittently in a few PRs':

This patch updates it to the latest as the speed of the latest version seems to be increased a lot per
golangci/golangci-lint#685 (comment).

Since we moved to go1.16 in #161 we were hitting a go bug (see golint prow job output below, when a workaround is not applied ) for how go build works with modules - golang/go#44129

` + make lint
cd hack/tools; go build -tags=tools -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
go: github.com/golangci/golangci-lint@v1.37.1: missing go.sum entry; to add it:
	go mod download github.com/golangci/golangci-lint
make: *** [Makefile:124: hack/tools/bin/golangci-lint] Error 1 `

This commit adds the -mod=mod flag for go build command in the Makefile (workaround mentioned in the issue).

@metal3-io-bot metal3-io-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 2, 2021
@furkatgofurov7 furkatgofurov7 changed the title 🌱 Update golangci-lint to latest 🌱 [WIP] Update golangci-lint to latest Mar 2, 2021
@fmuyassarov
Copy link
Copy Markdown
Member

I think you need to run go mod tidy after updating go.mod.

@furkatgofurov7 furkatgofurov7 force-pushed the bump-golangci-lint/furkat branch from 70a25ff to 0dd707b Compare March 2, 2021 22:20
@metal3-io-bot metal3-io-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 2, 2021
@furkatgofurov7 furkatgofurov7 force-pushed the bump-golangci-lint/furkat branch from ff7fa37 to 0816138 Compare March 3, 2021 09:20
@metal3-io-bot metal3-io-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 3, 2021
@furkatgofurov7 furkatgofurov7 force-pushed the bump-golangci-lint/furkat branch from 0816138 to 0dd707b Compare March 3, 2021 13:12
@metal3-io-bot metal3-io-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 3, 2021
@furkatgofurov7 furkatgofurov7 force-pushed the bump-golangci-lint/furkat branch from 0dd707b to bb896b7 Compare March 3, 2021 13:14
@metal3-io-bot metal3-io-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 3, 2021
@furkatgofurov7 furkatgofurov7 force-pushed the bump-golangci-lint/furkat branch from bb896b7 to 59bad04 Compare March 3, 2021 13:16
@metal3-io-bot metal3-io-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 3, 2021
@furkatgofurov7 furkatgofurov7 force-pushed the bump-golangci-lint/furkat branch from 59bad04 to 2db3b91 Compare March 3, 2021 14:19
@furkatgofurov7
Copy link
Copy Markdown
Member Author

/retest

@furkatgofurov7 furkatgofurov7 force-pushed the bump-golangci-lint/furkat branch from 2db3b91 to 85e1a3e Compare March 3, 2021 14:50
@fmuyassarov fmuyassarov force-pushed the bump-golangci-lint/furkat branch from 85e1a3e to 3196ca4 Compare March 3, 2021 21:26
@fmuyassarov
Copy link
Copy Markdown
Member

/test golint

@fmuyassarov
Copy link
Copy Markdown
Member

/test unit

@fmuyassarov
Copy link
Copy Markdown
Member

/test-integration

@furkatgofurov7
Copy link
Copy Markdown
Member Author

/test-centos-integration

@furkatgofurov7 furkatgofurov7 changed the title 🌱 [WIP] Update golangci-lint to latest 🌱 Update golangci-lint to latest Mar 4, 2021
@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 18, 2021
@fmuyassarov fmuyassarov force-pushed the bump-golangci-lint/furkat branch 2 times, most recently from d3a7655 to b516dc2 Compare March 18, 2021 22:17
@fmuyassarov
Copy link
Copy Markdown
Member

@kashifest @furkatgofurov7
I'm not sure how we ended up using gofmt instead of golint. But using golint image from quay instead of golang and replacing hack/gofmt with hack/golint.sh seems to fix the issue.

Quay is building the golint image from https://github.com/metal3-io/baremetal-operator/blob/e74c3d8461e2e5f55d3b0839988d04c254490c1e/hack/Dockerfile.golint

@furkatgofurov7
Copy link
Copy Markdown
Member Author

/test-centos-integration

@kashifest @furkatgofurov7
I'm not sure how we ended up using gofmt instead of golint. But using golint image from quay instead of golang and replacing hack/gofmt with hack/golint.sh seems to fix the issue.

True, I have not noticed it before, and this should be a bug, IMO? But if just changing to correct image helps, we do not need to bump golangci-lint version at all :/

@furkatgofurov7 furkatgofurov7 force-pushed the bump-golangci-lint/furkat branch from b516dc2 to 2097a42 Compare March 19, 2021 14:08
@metal3-io-bot metal3-io-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 19, 2021
Comment thread hack/tools/go.mod
Comment thread hack/tools/go.mod Outdated
@fmuyassarov fmuyassarov force-pushed the bump-golangci-lint/furkat branch from 2097a42 to eba1b2c Compare March 19, 2021 15:49
@metal3-io-bot metal3-io-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 19, 2021
@fmuyassarov fmuyassarov force-pushed the bump-golangci-lint/furkat branch from eba1b2c to 5a8414d Compare March 19, 2021 15:52
@metal3-io-bot metal3-io-bot removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 19, 2021
@fmuyassarov
Copy link
Copy Markdown
Member

/test-integration

2 similar comments
@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-integration

@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-integration

@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-centos-integration

3 similar comments
@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-centos-integration

@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-centos-integration

@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-centos-integration

@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-integration

2 similar comments
@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-integration

@maelk
Copy link
Copy Markdown
Member

maelk commented Apr 6, 2021

/test-integration

@metal3-io-bot
Copy link
Copy Markdown
Contributor

@furkatgofurov7: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
golint 576bdb0 link /test golint
generate 576bdb0 link /test generate
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@furkatgofurov7
Copy link
Copy Markdown
Member Author

Tackled in #206

/close

@metal3-io-bot
Copy link
Copy Markdown
Contributor

@furkatgofurov7: Closed this PR.

Details

In response to this:

Tackled in #206

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@metal3-io-bot
Copy link
Copy Markdown
Contributor

@furkatgofurov7: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates that a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants