Skip to content

ci: add Go lint + test + vuln scanning for antd-go - #112

Merged
Nic-dorman merged 2 commits into
mainfrom
nic/v2-339-antd-go-ci
May 20, 2026
Merged

ci: add Go lint + test + vuln scanning for antd-go#112
Nic-dorman merged 2 commits into
mainfrom
nic/v2-339-antd-go-ci

Conversation

@Nic-dorman

Copy link
Copy Markdown
Collaborator

Summary

antd-go ships as a v1.0 SDK but has had no CI coverage at all — the existing ci.yml path filter is antd/**, antd-rust/**, .github/workflows/ci.yml and skips antd-go entirely. Sibling Go project indelible already runs the canonical Go toolchain on every push/PR; this PR lifts that playbook over to antd-go.

New workflow: .github/workflows/go-ci.yml

Job Triggers Purpose
Lint every push + PR go vet, go mod verify, golangci-lint v1.64.8 (same version indelible pins to)
Test every push + PR go test -count=1 -timeout 5m ./...
Race detection main push only go test -race. Roughly doubles runtime so it runs as a post-merge canary rather than a per-PR gate.
Security Scanning main push only, continue-on-error: true govulncheck ./.... Advisory because govulncheck surfaces Go stdlib advisories that require toolchain upgrades (not code changes) and hits external registries — pattern lifted from indelible's ci.yml.

Concurrency settings mirror indelible: PR pushes cancel prior in-flight PR runs; main pushes never cancel.

Lint fixes (first golangci-lint pass)

The first run surfaced 8 hits, all mechanical:

  1. client_test.go × 29 — unchecked json.NewEncoder(w).Encode(...) in the mock daemon. Introduced a writeJSON helper that explicitly ignores the encode error and updated every call site (cleaner than scattering _ = prefixes). Realistic failure mode is the client dropping connection mid-response, which surfaces on the read side anyway.
  2. discover_test.go — macOS branch of withTempPortFile was the only one not wrapping os.MkdirAll / os.WriteFile in if err != nil { t.Fatal(err) }. Now matches the windows/linux branches.
  3. discover_windows.goproc.Release() return value explicitly discarded with _ =. Release failure is non-fatal for the "process exists" check.
  4. grpc_client_test.go × 2if err := s.Serve(lis); err != nil {} empty-branch blocks (SA9003). Replaced with deliberate-ignore _ = s.Serve(lis) + clarifying comment.

Test plan

  • go vet ./... clean in antd-go/
  • go mod verify: all modules verified
  • golangci-lint run ./... clean (v1.64.8)
  • go test ./...: PASS (~1.4s)
  • CI on this PR: Lint + Test jobs green; Race detection and Security Scanning not triggered until merged to main

Notes

  • golangci-lint and govulncheck are now in /c/Users/nbdor/go/bin/ locally. Will also install both on dev2 before this merges — see feedback memory: mirror CI tools onto dev2.
  • Govulncheck currently flags 8 Go stdlib vulnerabilities on the local toolchain (1.25.6 → fixed in 1.25.7). These don't block merges (advisory job) but will need either a Go toolchain pin bump or wait-for-runner-image-update before the security signal goes green. Filing a follow-up if it doesn't auto-clear.

Nic-dorman and others added 2 commits May 20, 2026 10:47
antd-go ships as a v1.0 SDK but has had no CI coverage — the existing
ci.yml path filter (antd/**, antd-rust/**) skips it entirely. Sibling
Go project indelible already runs the canonical playbook on every
push and PR; this lift brings antd-go to that bar.

New workflow .github/workflows/go-ci.yml:

- `Lint` (every push/PR): go vet, go mod verify, golangci-lint
  v1.64.8 — same toolchain version indelible pins to.
- `Test` (every push/PR): go test -count=1 -timeout 5m ./...
- `Race detection` (main-only): go test -race. Roughly doubles
  runtime so it runs as a post-merge canary rather than a per-PR gate.
- `Security Scanning` (main-only, continue-on-error): govulncheck.
  Advisory because govulncheck surfaces Go stdlib advisories that
  require toolchain upgrades (not code changes) and hits external
  registries — pattern lifted from indelible's ci.yml.

Cancel-in-flight + concurrency settings mirror indelible: PR pushes
cancel prior in-flight PR runs; main pushes never cancel.

Fixes the eight lint hits the first golangci-lint pass surfaces:

- `client_test.go`: 29 unchecked `json.NewEncoder(w).Encode(...)`
  call sites in the mock daemon. Introduces a `writeJSON` helper
  that explicitly ignores the encode error and updates every call
  site — cleaner than scattering `_ =` prefixes through the file.
  (The realistic failure mode is the client side dropping the
  connection mid-response; surfaces as the read-side test failing
  rather than the write-side.)
- `discover_test.go`: macOS branch was the only path in
  `withTempPortFile` not wrapping `os.MkdirAll` / `os.WriteFile`
  in `if err != nil { t.Fatal(err) }`. Matches the other branches.
- `discover_windows.go`: `proc.Release()` return value now
  explicitly discarded with `_ =` — release failure is non-fatal
  for the "process exists" check.
- `grpc_client_test.go`: two `if err := s.Serve(lis); err != nil {}`
  empty-branch blocks (SA9003) replaced with deliberate-ignore
  `_ = s.Serve(lis)` + clarifying comment.

Verified locally on Go 1.25.6 / golangci-lint v1.64.8:
- `go vet ./...` clean
- `go mod verify`: all modules verified
- `golangci-lint run ./...` clean
- `go test ./...`: PASS

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the negation-in-paths fix used in ci.yml. GitHub Actions
only allows EITHER `paths` OR `paths-ignore` on a trigger, not both
— combining them silently rejects the workflow with a "workflow
file issue" 0s failure. Use a negation pattern inside `paths`
instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman
Nic-dorman force-pushed the nic/v2-339-antd-go-ci branch from af6ea7a to 45ad96e Compare May 20, 2026 11:18
@Nic-dorman
Nic-dorman merged commit 72b6295 into main May 20, 2026
4 checks passed
@Nic-dorman
Nic-dorman deleted the nic/v2-339-antd-go-ci branch May 20, 2026 11:20
Nic-dorman added a commit that referenced this pull request May 21, 2026
Cuts v0.8.0 atop v0.7.1. Substantial breaking-change roll-up of the
put/get rename, the private-file PUT/GET gap close, and several minor
surface cleanups -- bundled here so the v1.0 cut can ship stable on top.

## Breaking (antd daemon)

- feat(antd)!: bind to 127.0.0.1 by default on REST and gRPC (#107).
  Previously bound 0.0.0.0; use --bind-rest / --bind-grpc to override.
- chore: remove dead graph_entry surface from antd proto + 5 SDKs (#92).
  GraphService and its 4 RPCs are gone; REST mounts dropped.
- chore: remove dir_upload_public / dir_download_public surface (#95).
  Use file_put_public on a directory path instead; the daemon recurses.
- feat(antd)!: normalize put/get convention + close private-file PUT and
  GET gaps (#115). Method renames across proto + REST + SDKs:
    data_put_private    -> data_put
    data_get_private    -> data_get
    file_upload_public  -> file_put_public
    file_download_public -> file_get_public
  New: file_put / file_get for the private file path (previously only
  the public variant existed). New typed results: DataPutResult,
  DataPutPublicResult, FilePutResult, FilePutPublicResult; PutResult
  is now annotated as chunk_put only.

## Additive

- feat(antd): honor payment_mode on gRPC put/cost paths and REST cost
  endpoints (#114). Optional kwarg threaded through every put/cost
  signature; empty/omitted maps to "auto" so older clients keep working.
- feat: external-signer public uploads + single-chunk prepare/finalize
  across 15 SDKs (#90).
- docs+spec: openapi.yaml refreshed for the v1.0 surface, including
  POST /v1/chunks/prepare and /v1/chunks/finalize for single-chunk
  external-signer publish (#126).

## SDK fan-out (PaymentMode + put/get convention, all 15)

#116 antd-go, #117 antd-py/ruby/elixir, #118 antd-rust, #119 antd-csharp,
#120 antd-java, #121 antd-swift, #122 antd-dart, #123 antd-kotlin,
#124 antd-cpp, #125 antd-js/php/zig/lua, #127 antd-mcp.

## SDK example + build fixes

- fix(antd-go): make 03-files example self-contained and runnable (#91)
- fix(examples): make 04-files runnable across cpp/rust/elixir/lua/php/ruby/zig (#93)
- fix(examples): runnable dart 04_files + java Example03Files; add java Example03Chunks (#94)
- feat: gRPC transport example for antd-py and antd-rust (#113)
- feat(antd-py): 07_external_signer example + ant-dev dispatcher entry (#98)
- feat(antd-js): 07-external-signer example + antd-py empty-payments fix (#99)
- feat(rust/go): 07-external-signer examples (#100)
- feat(antd-csharp): 07_external_signer example (#101)
- feat(antd-java): 07_external_signer example (#102)
- feat(antd-kotlin): 07_external_signer example (#103)
- feat(antd-dart): 07_external_signer example (#104)
- feat(antd-ruby): 07_external_signer example (#105)
- feat(antd-php): 07_external_signer example (#106)
- chore(antd-kotlin): drop stale GraphDescendant from local proto copy (#108)

## Docs / infra

- docs: external-signer flow reference + ABI + python smoke test (#97)
- docs: add SECURITY.md with threat model and disclosure policy (#109)
- docs!: refresh per-SDK READMEs + llms-full.txt + openapi.yaml for v1.0 surface (#126)
- ci: add Go lint + test + vuln scanning for antd-go (#112)
- ci: extend antd-rust to sibling-repo parity (fmt + clippy + audit + doc) (#111)
- ci: skip antd/openapi.yaml and llms-full.txt from triggering CI (#128)
- chore(scripts): add full-stack + integration sweep helpers (#96)
- fix(antd-rust): regenerate Cargo.lock to unbreak --locked CI (#110)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.

1 participant