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 の target があり、既存のテストがすべて成功することです。
索引モデルが 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時間
- マージ済み PR(30日)
- 29
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
AvengeMedia/DankMaterialShell#3761 ·
メンテナーはふだん 1 日以内に返信
-
docs: clarify replacement for outdated Terms of Service URL in readme.md対応中かも @mohitjoshi-hey が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SocialGouv/iterion#2320 ·
メンテナーはふだん 1 日以内に返信
-
helm chart: the first upgrade after install restarts the filer and S3 gateway although nothing changed対応中かも @egezamb が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[mesheryctl] Potential runtime panic (index out of range) in system status when pod container statuses are partially populated対応中かも @Ayush-AM が今日担当しました。 オープンcomponent/mesheryctl kind/bug language/go
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
meshery/meshery#22312 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信