Skip to content

ci(agent): gate Go vet + lint, race the full agent tree#2512

Merged
ToddHebebrand merged 2 commits into
mainfrom
ToddHebebrand/ci-agent-lint-race
Jul 16, 2026
Merged

ci(agent): gate Go vet + lint, race the full agent tree#2512
ToddHebebrand merged 2 commits into
mainfrom
ToddHebebrand/ci-agent-lint-race

Conversation

@ToddHebebrand

Copy link
Copy Markdown
Collaborator

What

Closes the deterministic-CI gaps for the Go agent that the recent agent work surfaced. Two new jobs + a golangci config — no product code changes.

lint-agent

  • go vet ./... as an unconditional gate. The tree is already vet-clean, so this is safe today and catches vet regressions going forward.
  • golangci-lint in new-issues-only mode (--new-from-rev=origin/<base>). Introduced red-safe: the pre-existing lint backlog (including ~20 unformatted files on main) does not block PRs; only issues on code a PR actually changes are reported. Burn down the backlog separately.
  • The existing lint job is JS/TS + compose guards only — the Go agent was never vet/lint-gated in CI (golangci-lint lived only in agent/Makefile).

test-agent-race

  • go test -race ./... across the whole linux-buildable agent tree (~80s locally). test-agent runs CGO-off, so the race detector never ran broadly. This covers new concurrency-heavy packages automatically — no hand-maintained package list to drift. Windows-only concurrency stays covered by the agent's Windows race/smoke jobs.

agent/.golangci.yml

  • golangci-lint v2 config: standard linters (errcheck, govet, ineffassign, staticcheck, unused) + gofmt formatter.

Verification (local)

  • go vet ./... → clean
  • go test -race -count=1 ./...green, 81s
  • golangci-lint config verify → exit 0
  • golangci-lint run --new-from-rev=origin/main ./...0 issues (red-safe confirmed)
  • actionlint .github/workflows/ci.yml → clean (the one SC2155 warning it reports is a pre-existing script, not these jobs)

Note for reviewer

These jobs are not required checks until added to branch protection. To enforce them as merge gates, add Lint Agent (Go) and Test Agent (race) to the required status checks.

LLM-based review (/code-review, /pr-review-toolkit:review-pr, /security-review) is intentionally kept local/on-demand, not wired into CI.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploying breeze with  Cloudflare Pages  Cloudflare Pages

Latest commit: a24dd58
Status: ✅  Deploy successful!
Preview URL: https://1502973b.breeze-9te.pages.dev
Branch Preview URL: https://toddhebebrand-ci-agent-lint.breeze-9te.pages.dev

View logs

@ToddHebebrand
ToddHebebrand force-pushed the ToddHebebrand/ci-agent-lint-race branch 4 times, most recently from 1690a97 to 47a4195 Compare July 16, 2026 04:55
Todd Hebebrand and others added 2 commits July 15, 2026 23:11
The `lint` job is JS/TS + compose guards only — the Go agent was never
vet/lint-gated in CI (golangci-lint lived only in agent/Makefile), and
`test-agent` runs CGO-off so the race detector never ran on the broad tree.

- lint-agent: `go vet ./...` (hard gate; tree is already vet-clean) +
  golangci-lint in new-issues-only mode (--new-from-rev) so the pre-existing
  backlog (incl. ~20 unformatted files) does not block PRs.
- test-agent-race: `go test -race ./...` across the whole linux-buildable
  agent tree (~80s) so new concurrency-heavy packages are covered without a
  hand-maintained list.
- agent/.golangci.yml: golangci-lint v2 config (standard linters + gofmt).

Verified locally: go vet clean, go test -race ./... green (81s),
golangci-lint --new-from-rev=origin/main = 0 issues, actionlint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Both new jobs turned CGO on (vet compiles with it; -race requires it), which
pulled in the agent's only cgo files — the linux X11/pcap capture backends
(pcap.h, X11/Xlib.h) — whose C headers aren't on the runner. The repo only
cgo-builds the agent on darwin (build-agent), never linux.

- lint-agent: run vet + golangci CGO-off (matches test-agent). vet/lint cover
  the CGO-off build; the cgo backends are compiled by build-agent.
- test-agent-race: -race needs CGO, so run on macos-latest — the repo's only
  cgo agent build path — reproducing the green local run. Concurrency logic is
  platform-independent. Adds CGO_LDFLAGS_ALLOW to match build-agent's darwin.

Verified: CGO=0 vet clean, CGO=0 golangci --new-from-rev = 0 issues,
CGO=1 go test -race ./... green locally (darwin, 81s), actionlint clean.
@ToddHebebrand
ToddHebebrand force-pushed the ToddHebebrand/ci-agent-lint-race branch from 47a4195 to a24dd58 Compare July 16, 2026 05:12
@ToddHebebrand
ToddHebebrand merged commit b3c6e17 into main Jul 16, 2026
44 checks passed
@ToddHebebrand
ToddHebebrand deleted the ToddHebebrand/ci-agent-lint-race branch July 16, 2026 05:53
ToddHebebrand pushed a commit that referenced this pull request Jul 17, 2026
golangci-lint gating (#2512) flags unchecked Close/SetReadDeadline in the
new PAM dismissal tests after the rebase onto main.

Co-Authored-By: Claude Fable 5 <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