ci: add go test, go vet, and staticcheck gates to the build-verify workflow
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 74/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- github-actions, go
- Bereich
- build-system, ci-cd, testing
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.
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 ./...
- Vorherrschende Sprache
- Go
- Sterne
- 58
- Forks
- 72
- Ø Merge
- 1 T. 7 Std.
- Gemergte PRs (30 T.)
- 22
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microcks/microcks-cli
-
Wrong link to test resultsEvtl. wieder frei @SajanBisht hat das vor 8 Tagen übernommen, und es ist kein Pull Request offen. Offencomponent/cli keep-open kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
microcks/microcks-cli#589 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Default configuration path falls back to the current directory when the home directory cannot be determinedEvtl. vergeben @Sarthak-Shreshtha01 hat das vor 12 Tagen übernommen. Offencomponent/cli kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
microcks/microcks-cli#583 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
microcks test exits with code 1 (contract failure) instead of code 11 (connection) when polling loop times outEvtl. vergeben @ish-g09 hat das vor 10 Tagen übernommen. Offencomponent/cli kind/bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
microcks/microcks-cli#573 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug: YAML parse error in config is silently swallowed, login overwrites all other contextsEvtl. vergeben @Sarthak-Shreshtha01 hat das vor 17 Tagen übernommen. Offencomponent/cli kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
microcks/microcks-cli#572 · 6 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
import-dir uploads secondary artifacts before their primary API definitionEvtl. vergeben @doraem-on hat das vor 24 Tagen übernommen. Offencomponent/cli kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
microcks/microcks-cli#561 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in microcks/microcks-cli
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 61/100
Maintainer antworten meist innerhalb von 1 Tag
-
stage-fail
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
siyuan-note/bazaar#2405 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug priority: high workstream:cache
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
rossoctl/context-guru#707 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
prime-radiant-inc/evener#5028 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag