microcks / microcks/microcks-cli
ci: add go test, go vet, and staticcheck gates to the build-verify workflow
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 52
- Forks
- 68
- Ø Merge
- 6 Std. 54 Min.
- Gemergte PRs (30 T.)
- 10
Beschreibung
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 ./...
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit .github/workflows/build-verify.yml und dem vorhandenen Build Go packages-Schritt, untersuche anschließend Makefile und führe die vorgeschlagenen Go-Prüfungen lokal aus. Als erledigt gilt die Aufgabe, wenn der Workflow bei Pushes und Pull Requests go test ./..., go vet ./... und staticcheck ausführt, passende make test- und make vet-Targets vorhanden sind und alle bestehenden Tests erfolgreich bestehen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- github-actions, go
- Bereich
- build-system, ci-cd, testing
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 74/100