fix(ci): regenerate stale Go BUILD files via gazelle — unbreak bazel (#3425) #3492

Merged
mfreeman451 merged 1 commit from fix/agent-bazel-go-library-srcs into staging 2026-06-01 13:06:27 +00:00
Owner

What

The bazel lane is red on staging: //go/pkg/agent:agent (+ :agent_test, selected by CI's tests(//...)) fails to build, with cascading staleness:

push_loop.go: undefined: icmpCheckConfig                       (agent: split file not in srcs)
push_loop_config.go: undefined: bumblebee.WriteRuntimeProfile  (bumblebee: stale srcs)
sshca-signer: lib missing @org_golang_x_crypto//ssh dep

Recent refactors added/moved Go files (and a new cross-package symbol) without updating the checked-in BUILD.bazel srcs/deps. CI runs bazel test with 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:

  • gazelle the agent subtree + bumblebee — adds missing srcs/deps (incl. #3490's push_loop_addon_status_test.go).
  • sshca-signer — add the missing @org_golang_x_crypto//ssh lib dep by hand; dropped a bogus duplicate test target gazelle emitted (:sshca-signer_lib doesn't exist).
  • # gazelle:exclude .claude in 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_goingcompletes successfully (was failing).
  • db-event-writer_test + other hand-tuned packages confirmed still green.

Follow-up

Dir-scoped gazelle PostToolUse hook (local) now runs on Go-file writes; the deeper systemic staleness fits the proposed add-hermetic-native-addon-builds work + a CI gazelle -mode=diff gate.

🤖 Generated with Claude Code

## What The bazel lane is **red** on `staging`: `//go/pkg/agent:agent` (+ `:agent_test`, selected by CI's `tests(//...)`) fails to build, with cascading staleness: ``` push_loop.go: undefined: icmpCheckConfig (agent: split file not in srcs) push_loop_config.go: undefined: bumblebee.WriteRuntimeProfile (bumblebee: stale srcs) sshca-signer: lib missing @org_golang_x_crypto//ssh dep ``` Recent refactors added/moved Go files (and a new cross-package symbol) **without updating the checked-in `BUILD.bazel` srcs/deps**. CI runs `bazel test` with **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: - **gazelle the `agent` subtree + `bumblebee`** — adds missing srcs/deps (incl. #3490's `push_loop_addon_status_test.go`). - **`sshca-signer`** — add the missing `@org_golang_x_crypto//ssh` lib dep by hand; dropped a bogus duplicate test target gazelle emitted (`:sshca-signer_lib` doesn't exist). - **`# gazelle:exclude .claude`** in 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 `PostToolUse` hook (local) now runs on Go-file writes; the deeper systemic staleness fits the proposed `add-hermetic-native-addon-builds` work + a CI `gazelle -mode=diff` gate. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ci): regenerate stale Go BUILD files via gazelle (unbreak bazel) (#3425)
Some checks failed
Secret Scan / gitleaks (pull_request) Successful in 27s
Rust Add-on Interop Test / interop (push) Successful in 1m47s
Golang Tests / test-go (push) Successful in 1m49s
lint / lint (push) Successful in 1m50s
lint / lint (pull_request) Successful in 1m34s
CI / build (pull_request) Failing after 5m12s
1ba91ea6b4
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>
mfreeman451 force-pushed fix/agent-bazel-go-library-srcs from 1ba91ea6b4
Some checks failed
Secret Scan / gitleaks (pull_request) Successful in 27s
Rust Add-on Interop Test / interop (push) Successful in 1m47s
Golang Tests / test-go (push) Successful in 1m49s
lint / lint (push) Successful in 1m50s
lint / lint (pull_request) Successful in 1m34s
CI / build (pull_request) Failing after 5m12s
to f2258d5bc0
Some checks failed
Secret Scan / gitleaks (pull_request) Successful in 24s
lint / lint (pull_request) Successful in 1m17s
lint / lint (push) Successful in 1m19s
Golang Tests / test-go (push) Successful in 1m32s
CI / build (pull_request) Failing after 4m38s
2026-06-01 05:45:24 +00:00
Compare
mfreeman451 left a comment

lgtm

lgtm
mfreeman451 deleted branch fix/agent-bazel-go-library-srcs 2026-06-01 13:06:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar!3492
No description provided.