refactor(shard-distributor): centralize ETCD client and config in etcdclient package#7838
Merged
jakobht merged 2 commits intocadence-workflow:masterfrom Mar 23, 2026
Merged
Conversation
Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
…ient Move config types and parsing to etcdclient package: - Add BaseConfig with common fields (endpoints, dialTimeout, prefix) - Add ExecutorStoreConfig and LeaderStoreConfig extending BaseConfig - Parse configs once via FX, eliminating double-parsing - Rename LeaderCfg to SDConfig in tests for clarity Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
🔍 CI failure analysis for 42437db: Network connectivity issue during CI initialization—DNS resolution failure when downloading protoc prevented the build from starting; unrelated to the refactoring changes.OverviewOne CI log analyzed across 1 job. The failure is a transient infrastructure issue occurring during build initialization, not related to the PR's code changes (etcdclient refactoring). FailuresNetwork DNS Resolution Failure During Build Initialization (confidence: high)
Summary
Code Review ✅ ApprovedCentralizes ETCD client and configuration management in a dedicated etcdclient package, improving code organization and maintainability. No issues found. Rules ✅ All requirements metRepository Rules
1 rule not applicable. Show all rules by commenting Tip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
eleonoradgr
approved these changes
Mar 23, 2026
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 changed?
Centralizes ETCD client creation, config parsing, and session management into the
etcdclientpackage. Theetcdclient.Clientinterface now includesClose()andNewSession()methods, with aclientWrapperimplementation. Config types (BaseConfig,ExecutorStoreConfig,LeaderStoreConfig) and a sharedNewClientFromConfigprovider are added. Theetcd/module.gowires named clients (executorstore,leaderstore) via fx.This removes duplicated client creation and config parsing from
executorstoreandleaderstore, and eliminatesleaderstore's direct dependency on*clientv3.Client.Re-land of #7799, which was reverted in #7817. This version also includes the config centralization refactor on top.
Why?
Clientinterface mockable for session-based operations (leader election), improving testability.How did you test it?
go test ./service/sharddistributor/store/etcd/... -count=1).etcdclient/config_test.go.Potential risks
Low — this is an internal refactor with no behavior changes. The fx wiring is the main area to watch.
Release notes
None
Documentation Changes
None