Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

ci: add go test, go vet, and staticcheck gates to the build-verify workflow

Offen
#355 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Harishrs2006 arbeitet bereits daran.

Seit 09.5.2026.

  • #356 von @Harishrs2006 — offen

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

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

component/build kind/task
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:

  1. req.Body read instead of resp.Body in DownloadArtifact → PR #338 (go vet catches this)
  2. panic(err.Error()) in connector code → PR #341, #319 (staticcheck catches this)
  3. TestDeleteContext fails on every clean checkout → PR #334 (go test ./... catches this)
  4. OAuth2 tokens printed unconditionally to stderr → PR #345 (caught by tests with log capture)
  5. String-concatenation JSON injection risk → PR #341 (staticcheck catches 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:

  1. go test ./... — runs the existing unit test suite (currently never executed in CI)
  2. go vet ./... — Go's built-in analyser, catches real bugs like wrong body reads, bad panic arguments, printf mismatches
  3. staticcheck — 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

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microcks/microcks-cli

Alle Issues in microcks/microcks-cli

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.