ci: add go test, go vet, and staticcheck gates to the build-verify workflow
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 74/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- github-actions, go
- 领域
- build-system, ci-cd, testing
调研方向
从 .github/workflows/build-verify.yml 和现有的 Build Go packages 步骤开始,然后检查 Makefile 并在本地运行提议的 Go 检查。完成意味着 workflow 在 pushes 和 pull requests 上运行 go test ./...、go vet ./... 和 staticcheck,具有相应的 make test 和 make vet targets,并且所有现有测试都通过。
由索引模型根据 Issue 内容生成。
描述
Reason/Context
The current build-verify.yml CI workflow only compiles binaries — it never runs tests, go vet, or any static analysis. This means bugs ship silently and contributors get no automated feedback on correctness.
Proof from the current open PR queue — every one of these bugs existed in master and CI never caught them:
req.Bodyread instead ofresp.BodyinDownloadArtifact→ PR #338 (go vetcatches this)panic(err.Error())in connector code → PR #341, #319 (staticcheckcatches this)TestDeleteContextfails on every clean checkout → PR #334 (go test ./...catches this)- OAuth2 tokens printed unconditionally to stderr → PR #345 (caught by tests with log capture)
- String-concatenation JSON injection risk → PR #341 (
staticcheckcatches this)
The motivation: CI should be the first line of defence. Right now it is not.
Description
Add three mandatory quality gates to build-verify.yml that run on every PR and push:
go test ./...— runs the existing unit test suite (currently never executed in CI)go vet ./...— Go's built-in analyser, catches real bugs like wrong body reads, bad panic arguments, printf mismatchesstaticcheck— industry-standard linter, zero config, no false positives
Also add make test and make vet targets to Makefile so contributors can run the same checks locally before pushing.
This is not a breaking change — it only adds new CI steps. If existing tests are currently failing on master,
those failures will need to be fixed as part of this PR.
Implementation ideas
Add before the existing Build Go packages step in .github/workflows/build-verify.yml:
- name: Run unit tests
run: go test ./...
- name: Run go vet
run: go vet ./...
- name: Run staticcheck
uses: dominikh/staticcheck-action@v1
with:
version: latest
install-go: false
`staticcheck` is preferred over `golangci-lint` — zero config, no false positives, directly catches the bug classes above.
Add to `Makefile`:
```makefile
.PHONY: test
test:
go test ./...
.PHONY: vet
vet:
go vet ./...
- 主要语言
- Go
- 星标
- 57
- 派生
- 73
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 29
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microcks/microcks-cli 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
microcks/microcks-cli#573 · 1 条评论 ·
维护者通常 1 天内回复
-
bug: YAML parse error in config is silently swallowed, login overwrites all other contexts可能已有人在做 @Sarthak-Shreshtha01 于 3 天前认领。 未关闭component/cli kind/bug
难度 2/5 1-3 小时 新手友好度 76/100
microcks/microcks-cli#572 · 5 条评论 ·
维护者通常 1 天内回复
-
import-dir uploads secondary artifacts before their primary API definition可能已有人在做 @doraem-on 于 10 天前认领。 未关闭component/cli kind/bug
难度 2/5 1-3 小时 新手友好度 88/100
microcks/microcks-cli#561 · 3 条评论 ·
维护者通常 1 天内回复
-
TEST: `ConnectAndGetToken` Returns Error on Non-200 Response可能已有人在做 @aniket866 于 13 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
microcks/microcks-cli#554 ·
维护者通常 1 天内回复
-
Empty `AuthToken` Causes Cryptic JWT Parse Error可能已有人在做 @aniket866 于 13 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
microcks/microcks-cli#551 ·
维护者通常 1 天内回复
查看 microcks/microcks-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
signal18/replication-manager#1981 ·
维护者通常 1 天内回复
-
Battery UI: German word "Speicher"可能已有人在做 @github-actions 今天认领。 未关闭ux
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
ready-for-agent
难度 2/5 1-3 小时 新手友好度 83/100
jasonfen/terminal-space-program#611 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
prime-radiant-inc/evener#4329 ·
维护者通常 1 天内回复