-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(*): update golangci-lint version from 1.16.0 to 1.20.1 #14
Conversation
.golangci.yml
Outdated
@@ -1,6 +1,6 @@ | |||
run: | |||
# concurrency: 2 | |||
deadline: 5m | |||
deadline: 10m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to increase deadline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deadline
这个参数已经废弃,使用 timeout
代替 deadline
。
golangci/golangci-lint#793
golangci/golangci-lint#822
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个还是要放开各个组件自己可以改的吧,cluster 这边有时候 lint 要耗时 10+min 的,所以我这边都在改成了 20min
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
各组件是可以自己改,不过如果时间太长的话,就得想办法优化。我觉得低于 5 min 是可以接受的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is timeout: 5m
OK for the template? @supereagle @lsytj0413 @Meoop
|
||
$(GOLANGCI_LINT): | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR) v1.16.0 | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR) v1.20.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是把 version 这玩意整成一个变量,放到前面去
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只有一个地方用到,设不设变量无所谓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
关键是保不齐下次又要改新版本。。。用变量传递的话,可以做到流水线直接传递。。就不需要改了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果已经存在 golangci-lint 这个文件,更新版本号,$(GOLANGCI_LINT):
不会再执行的。想要用流水线控制下载的版本,那需要 golangci-lint 文件不存在,每次都拉。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
流水线更新 golang:1.12.9-stretch 镜像 就可以了。
为了保证一致性,Makefile 还是得更新
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我个人建议,不要从外部以变量的方式传递到Makefile里。 编译整套系统(包括里面的工具)最好是紧跟代码(分支)走。(虽然当前我们受限于流水线系统也没真正做到,但自己能控制的尽量自己控制住)
否则,外部lint工具做了更新扫出新的一顿错误,那历史分支就挂了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
恩,对了,还有 golang 版本谁在关注呢?k8s 有更新 golang 版本 kubernetes/kubernetes#84064
不用跟得这么紧吧。。呼唤钊总 @iawia002
这个节奏还是你 @supereagle 定一下吧,proposal 里面写的是 follow 我们平台 k8 使用的 go 版本,但是我们平台的 k8 从来不升级小版本的。
- 如果 follow 具体的 k8 小版本,比如现在的 1.14.2,那 go 基本是一个大的 cps 版本升级一次
- 如果 follow 大版本,比如现在的 1.14.x,go 版本一个 cps 版本中估计要改好几次,因为 k8 基本在追最新的 go 版本(1.14.x --> 1.12.x),这样相当于我们也要一直追一个最新的 go 版本
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我个人建议,不要从外部以变量的方式传递到Makefile里。
同意
这个节奏还是你 @supereagle 定一下吧,proposal 里面写的是 follow 我们平台 k8 使用的 go 版本,但是我们平台的 k8 从来不升级小版本的。
那就 follow k8s 的小版本吧,我们没有必要跟的这么紧,成本太高了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
很多更新的主要原因都是有涉及到安全的 bug 导致的,例如 1.12.9 ->1.12.10 修复的一个比较严重的 CVE-2019-16276(net/http 的 bug,在一些配置情况下可以绕过 k8s 身份认证)。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ijumps 对于上面提到的安全问题,我们在 2.10 中打算升级 k8s 小版本吗?
1.20.1 确定了吗? |
现在提议是 1.20.1,如果没有人提 1.20.1 有啥问题,那就是 1.20.1 了。 |
ba4db7f
to
df7cacb
Compare
@Meoop 说 |
先不做修改,避免引入同步的工作量。等下次版本再次升级的时候,再修改,可能 lint config 也会进一步优化。 |
/lgtm |
1.16 -> 1.20.1 不用同步吗?而且只是把 |
1.16 -> 1.20.1 需要同步,但是同步的内容仅是 makefile。
|
clear |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bbbmj, supereagle The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Golangci-lint 版本升级后能减少大量的内存消耗。即使去掉 GOGC=5 的配置,升级后的版本消耗的 memory 也更小。
Which issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes #
Reference to #
Special notes for your reviewer:
/cc @bbbmj @caicloud/yilei-write @supereagle
Release note: