Repository navigation
ci: add a go job with build, test, gofmt and golangci-lint - #78
Conversation
This repo had NO Go CI: only pr-validator.yml and tag-on-merge.yml, neither of which builds, tests or lints the module. The only enforcement was the local pre-commit hook, so nothing kept main green between commits. The drift is not hypothetical, and it recurs. opencharly/charly#464 measured 11 findings on this repo's main on 2026-08-29; #68 cleared them; main has 2 again today, from #73: lock/filelock_timeout_test.go:25:15: Error return value of `f.Close` is not checked lock/filelock_timeout_test.go:30:15: Error return value is not checked Both are deferred calls in a test whose errors were never meant to be consumed; they are made explicit rather than silenced, so the gate lands green. That recurrence is the argument for the gate. Because the hook lints the WHOLE repo rather than the diff, these two findings would have blocked the next contributor to touch this repo — someone with no connection to #73. golangci-lint is pinned by module version rather than a third-party action, so the CI binary is the same build the hook uses locally and a new upstream release cannot turn main red on its own schedule. Second instance of the go-ci-lint-parity batch, after opencharly/charly#486. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
Review — PASSHead SHA: Security screen: PASS — new CI workflow adds build/test/gofmt/golangci-lint gates (strengthening, not weakening); Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — new CI workflow adds build/test/gofmt/golangci-lint gates (strengthening, not weakening); Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
…mage (#83) main is red. #82 split ResolveLocalImage into a gather and an election, and the election kept a shortName parameter it never reads — the name filtering all happens in gatherResolverCandidates, before election. container/local_image_coneb.go:505:82: electResolvedImage - shortName is unused (unparam) Caught by the golangci-lint gate added in #78, one commit after it landed, on its own author. That is the gate working exactly as intended: without it this would have sat on main until it blocked whoever touched this repo next, because the pre-commit hook lints the WHOLE repo rather than the diff. I ran `go build ./container/`, `go vet ./container/` and `go test ./container/` before #82 but not `golangci-lint run ./...` — the one check that would have seen it. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6 Co-authored-by: atrawog <[email protected]>
Summary
Second instance of the
go-ci-lint-paritybatch (opencharly/charly#464), after opencharly/charly#486.This repo had no Go CI at all — only
pr-validator.ymlandtag-on-merge.yml, neither of which builds, tests or lints the module. The only enforcement was the local.claude/hooks/pre-commit-gate.sh, so nothing keptmaingreen between commits.Adds a
gojob: build, test, gofmt, golangci-lint.The drift is real, and it recurs
charly#464 measured 11 findings on this repo's
mainon 2026-08-29. #68 cleared them.mainhas 2 again today, introduced by #73:That is the whole argument for the gate, observed twice in two days on one repo. And the cost does not land on whoever caused it: because the hook lints the whole repo rather than the diff, these two findings would have blocked the next contributor to touch this repo — someone with no connection to #73.
Both are deferred calls in a test whose errors were never meant to be consumed. They are made explicit (
defer func() { _ = f.Close() }()) rather than silenced with a nolint, so the gate lands green on a tree that is genuinely clean.How tested
The exact commands the job runs, against this tree:
Before the two-line fix that same lint run reported:
and
go test ./lock/still passes after it:Workflow parses:
The job's own run on this PR is the live proof it executes and passes.
Two deliberate choices
Pinned by module version, not a third-party action.
go install github.com/golangci/golangci-lint/v2/cmd/[email protected]makes the CI binary the same build the pre-commit hook uses locally. A gate that disagrees with the hook is worse than no gate: it fails people who did everything right. It also means a new upstream release cannot turnmainred on its own schedule.build + test + gofmt alongside the lint, because this repo had none of them in CI — adding only the lint step would leave a module whose tests nothing runs.
Rulebook compliance
main), not asserted.mainred would be exactly the split R2 forbids..golangci.yml; no parallel lint configuration.Change classification
fully tested and validated— the gate was run before and after the fix it required, and the suite passes against the committed treeAssisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)