microcks-cli icon indicating copy to clipboard operation
microcks-cli copied to clipboard

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

Open Harishrs2006 opened this issue 6 months ago • 1 comments

Summary:

The CI pipeline only compiled binaries — go test, go vet, and static analysis never ran on any PR. Real bugs shipped undetected as a result.

Evidence: what these gates catch

Bug PR Gate that catches it
req.Body read instead of resp.Body #338 go vet
panic(err.Error()) in connector code #341, #319 staticcheck
TestDeleteContext fails on clean checkout #334 go test ./...
String-concatenation JSON injection #341 staticcheck
fmt.Errorf result discarded in watcher/executor.go this PR go vet ← caught immediately

Changes:

  1. .github/workflows/build-verify.yml — add go test ./..., go vet ./..., and staticcheck steps before the build step
  2. Makefile — add make test and make vet targets for local developer use
  3. pkg/watcher/executor.go — fix go vet finding: fmt.Errorf return value was discarded, silently swallowing config load errors (replaced with fmt.Printf + return)

Testing

go test ./... ✅ all pass go vet ./... ✅ clean (after executor.go fix) go build ./... ✅ clean

Fixes #355

Harishrs2006 avatar May 09 '26 19:05 Harishrs2006

happy to adjust anything...

Harishrs2006 avatar May 14 '26 18:05 Harishrs2006