deprecate the unused Peer struct#591
Conversation
Peer is part of the public API but is no longer constructed or used anywhere in the crate. It is a leftover from the removed bootstrap API that accepted an initial peer set and turned it into ConfChange entries using the peer context. A cluster is now bootstrapped by proposing ConfChange entries directly, so Peer only lingers as a confusing, unused type. Deprecate it rather than remove it to avoid a breaking change. Signed-off-by: satyakwok <119509589+satyakwok@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesPeer Deprecation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Addresses #99.
`Peer` is public and re-exported, but it is never constructed or used anywhere in the crate. It is a leftover from the old bootstrap API that accepted an initial peer set and turned it into `ConfChange` entries using each peer's context. That path was removed; a cluster is now bootstrapped by the application proposing `ConfChange` entries directly (`RawNode::propose_conf_change`), so `Peer` only lingers as a confusing, unused type. Its doc still implied the old context-injection behavior, which is the confusion #99 is about.
This marks `Peer` `#[deprecated]` (rather than removing it, to avoid a breaking change) and updates its docs to describe the current state. The two re-exports get `#[allow(deprecated)]`, matching the existing `is_empty_snap` pattern, so the crate still builds under `--deny=warnings`.
As mentioned in #99, happy to go a different way if you would rather keep `Peer` and just document that it is unused. `cargo check` is clean with `RUSTFLAGS=--deny=warnings`.
Signed-off-by: satyakwok 119509589+satyakwok@users.noreply.github.com
Summary by CodeRabbit
Peertype is now deprecated. UseRawNode::propose_conf_changefor cluster bootstrapping instead.