ci: align build workflow lint with make lint#434
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
#373 合入后,GitHub Actions 的
Backend Build和Storage Build在main分支 push workflow 中失败。这里失败的不是 PR check,也不是业务代码编译失败。#373 的 PR check 能通过,是因为
backend-pr.yml和storage-pr.yml已经改为执行项目统一入口:make lintlint-full使用backend/.golangci-full.ymllint-diff使用backend/.golangci-diff.yml但合入后触发的 push build workflow 仍然直接调用
golangci/golangci-lint-action@v8。#373 已经把原来的默认 lint 配置拆成了 full/diff 两套配置,build workflow 没同步后,就没有走项目定义的 lint 入口,导致 CI 对历史代码执行了全量默认检查。因此 Actions 中暴露的是既有历史问题,例如:
errcheck:历史代码里部分Close()/fmt.Fprintf()返回的 error 没有处理。staticcheck:历史代码里仍有 deprecated 的resputil.*调用。这些问题不属于本次 PR 的新增 diff,也不是 #373 的 runtime 修复引入的错误。
修改内容
本 PR 将 push build workflow 的 lint 入口与 PR workflow 对齐:
Backend Build:准备upstream/main后执行make lint。Storage Build:准备upstream/main后执行make lint。这样 build workflow 和 PR workflow 会使用同一套 lint 规则,避免 merge 后因为入口不一致再次扫出历史全量问题。
验证
本地已完成以下验证:
并将本地
refs/remotes/upstream/main刷新到当前 upstreammain后执行:cd backend make lint结果:
lint-full:0 issueslint-diff:0 issues