Repository navigation
chore(agent): remove two functions nothing calls (sleepCtx, hashResource) - #1162
Merged
Merged
Conversation
…hashResource in xds/cache) - agent/internal/spire.sleepCtx lost its last caller in #1135 (the bridge's retry ladder moved to a context-bounded wait). - agent/internal/xds/cache.hashResource was added in #1114 alongside versionMemo.hash and was never called; every caller uses the memo. Proof: golang.org/x/tools/cmd/deadcode run through rules_go's gopackagesdriver over every first-party main package reports both as unreachable, and `grep -rnw` finds no reference outside the definition in any .go file (production or test), chart, doc, e2e script or workflow. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes two unexported functions with zero callers:
sleepCtxagent/internal/spire/bridge.gohashResourceagent/internal/xds/cache/versionmemo.go-15 lines, no behaviour change (the linker already dropped both: the
cache_testbinary is byte-identical, so Bazel served it from cache).Proof
deadcode(golang.org/x/tools/cmd/deadcode) run through rules_go's gopackagesdriver over every first-party main package (GOPACKAGESDRIVER=<bazel run @rules_go//go/tools/gopackagesdriver> deadcode -filter '^aethermesh.dev/' ./agent/... ./cni/... ./registrar/... ./controller/... ./prober/... ./registry/... ./common/... ./e2e/... ./tools/... ./test/...) lists both asunreachable func.grep -rnw sleepCtx agent/internal/spireandgrep -rnw hashResource agent/internal/xds/cachematch only the definition and its comment, in production and_test.gofiles alike. (agent/internal/proxy/hotrestarthas its own, livesleepCtx, which is a different package.)Checks
bazel test --config=race //agent/internal/spire:all //agent/internal/xds/cache:all: passbazel build --config=lint --@aspect_rules_lint//lint:fail_on_violationon both packages: cleanmake format-check: cleanFound by the dead-code / dependency audit (2026-10-03).
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr