Skip to content

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

Open
Harishrs2006 wants to merge 1 commit into
microcks:masterfrom
Harishrs2006:ci/add-test-vet-staticcheck-gates
Open

ci: add go test, go vet, and staticcheck gates to build-verify workflow#356
Harishrs2006 wants to merge 1 commit into
microcks:masterfrom
Harishrs2006:ci/add-test-vet-staticcheck-gates

Conversation

@Harishrs2006
Copy link
Copy Markdown

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 vetcaught 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

The CI pipeline only compiled binaries — tests, go vet, and static
analysis never ran on any PR. This allowed real bugs to ship undetected:
- req.Body/resp.Body mismatch (PR microcks#338) caught by go vet
- panic(err.Error()) in connectors (PR microcks#341, microcks#319) caught by staticcheck
- TestDeleteContext failing on clean checkout (PR microcks#334) caught by go test
- fmt.Errorf result discarded in watcher/executor.go caught by go vet (fixed here)

Add three mandatory steps before the build: go test ./..., go vet ./...,
and staticcheck via dominikh/staticcheck-action. Also add make test and
make vet targets for local developer use.

Also fix the go vet finding in pkg/watcher/executor.go where fmt.Errorf
was called but its return value was discarded, silently swallowing errors.

Fixes microcks#355

Signed-off-by: Harish R S <harishrs21082006@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant