fix(ci): regenerate stale Go BUILD files via gazelle — unbreak bazel (#3425) #3492
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!3492
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/agent-bazel-go-library-srcs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The bazel lane is red on
staging://go/pkg/agent:agent(+:agent_test, selected by CI'stests(//...)) fails to build, with cascading staleness:Recent refactors added/moved Go files (and a new cross-package symbol) without updating the checked-in
BUILD.bazelsrcs/deps. CI runsbazel testwith no gazelle step, so stale checked-in BUILDs break the lane —go test ./...passed (go.mod) while bazel did not.Fix — scoped, not blanket
A blanket
gazelle //...is unsafe: it clobbers hand-tuned deps (e.g.db-event-writer's otlp pin → "multiple copies of package" linker error) and emits duplicate targets. Scoped to the genuinely-broken packages:agentsubtree +bumblebee— adds missing srcs/deps (incl. #3490'spush_loop_addon_status_test.go).sshca-signer— add the missing@org_golang_x_crypto//sshlib dep by hand; dropped a bogus duplicate test target gazelle emitted (:sshca-signer_libdoesn't exist).# gazelle:exclude .claudein the root BUILD so gazelle ignores the gitignored agent worktrees under.claude/(ambiguous duplicate targets locally; CI never sees.claude/).10 BUILD files; no source changes. Hand-tuned packages left untouched.
Validation
bazel build //go/... --keep_going— completes successfully (was failing).db-event-writer_test+ other hand-tuned packages confirmed still green.Follow-up
Dir-scoped gazelle
PostToolUsehook (local) now runs on Go-file writes; the deeper systemic staleness fits the proposedadd-hermetic-native-addon-buildswork + a CIgazelle -mode=diffgate.🤖 Generated with Claude Code
The bazel lane was red: //go/pkg/agent:agent (and :agent_test, which CI's tests(//...) query selects) failed to build — push_loop.go:99: undefined: icmpCheckConfig push_loop_config.go:279: undefined: bumblebee.WriteRuntimeProfile Recent refactors (the push_loop_*/addon_* split, bumblebee runtime-profile work, etc.) added/moved Go files without updating the checked-in BUILD.bazel srcs/deps, and CI runs `bazel test` with no gazelle step — so it uses the stale checked-in BUILDs. `go test ./...` passed (go.mod resolution) while bazel did not. Ran `bazel run //:gazelle -- go` to bring every Go package's BUILD back in sync with its sources (srcs + deps), incl. BUILD files for packages that had none. Also `# gazelle:exclude .claude` in the root BUILD so gazelle doesn't index the gitignored agent worktrees under .claude/ (which created ambiguous duplicate targets locally; CI never sees .claude/). Validated: `bazel build //go/...` completes successfully (was failing); //go/pkg/agent:agent + :agent_test build clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1ba91ea6b4f2258d5bc0lgtm