Skip to content

ci: align build workflow lint with make lint#434

Merged
Jinghao-coding merged 1 commit into
raids-lab:mainfrom
Cx330-502:fix/build-workflow-lint
Jun 17, 2026
Merged

ci: align build workflow lint with make lint#434
Jinghao-coding merged 1 commit into
raids-lab:mainfrom
Cx330-502:fix/build-workflow-lint

Conversation

@Cx330-502

@Cx330-502 Cx330-502 commented Jun 17, 2026

Copy link
Copy Markdown
Member

背景

#373 合入后,GitHub Actions 的 Backend BuildStorage Buildmain 分支 push workflow 中失败。

这里失败的不是 PR check,也不是业务代码编译失败。#373 的 PR check 能通过,是因为 backend-pr.ymlstorage-pr.yml 已经改为执行项目统一入口:

  • make lint
  • lint-full 使用 backend/.golangci-full.yml
  • lint-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 后因为入口不一致再次扫出历史全量问题。

验证

本地已完成以下验证:

git diff --check

并将本地 refs/remotes/upstream/main 刷新到当前 upstream main 后执行:

cd backend
make lint

结果:

  • lint-full: 0 issues
  • lint-diff: 0 issues

@Cx330-502 Cx330-502 requested a review from LeiXZ June 17, 2026 09:22
@Jinghao-coding Jinghao-coding merged commit f54cd3d into raids-lab:main Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants