-
Notifications
You must be signed in to change notification settings - Fork 134
rename --cluster-advertise back to --cluster-node #633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe pull request renames the cluster address key from Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
rs/moq-relay/src/cluster.rs (2)
24-28: CLI compat looks good; confirm env var deprecation and preferlong_alias.
- serde alias keeps config files with
advertiseworking. Good.- CLI alias
--cluster-advertiseworks, but consider usinglong_alias = "cluster-advertise"for clarity. Functionally equivalent, more explicit.- The env var changed to
MOQ_CLUSTER_NODEwith no alias forMOQ_CLUSTER_ADVERTISE. If dropping the old env var is intentional, document it in release notes. If not, add a lightweight fallback (e.g., hydratenodefromstd::env::var("MOQ_CLUSTER_ADVERTISE")when unset) inCluster::new.Also add colocated tests to lock this in (per guidelines):
- clap: both
--cluster-nodeand--cluster-advertisepopulatenode.- serde: TOML with
node = "x"and withadvertise = "y"both deserialize.Example tests to add within this file:
#[cfg(test)] mod tests { use super::*; use clap::Parser as _; #[derive(clap::Parser, Debug)] struct TestCli { #[command(flatten)] cluster: ClusterConfig, } #[test] fn cli_accepts_node_and_advertise_alias() { let p = TestCli::parse_from(["bin", "--cluster-node", "a.example:443"]); assert_eq!(p.cluster.node.as_deref(), Some("a.example:443")); let p = TestCli::parse_from(["bin", "--cluster-advertise", "b.example:443"]); assert_eq!(p.cluster.node.as_deref(), Some("b.example:443")); } #[test] fn serde_accepts_node_and_advertise() { let cfg: ClusterConfig = toml::from_str(r#"node = "n.example:443""#).unwrap(); assert_eq!(cfg.node.as_deref(), Some("n.example:443")); let cfg: ClusterConfig = toml::from_str(r#"advertise = "a.example:443""#).unwrap(); assert_eq!(cfg.node.as_deref(), Some("a.example:443")); } }
109-109: Self-connect guard is correct; consider normalization to avoid false mismatches.Direct string equality can misfire if casing or formatting differs (e.g.,
EXAMPLE.com:443vsexample.com:443). Consider normalizing to lower-case host and explicit port before comparing, or parse viaUrland compare host+port tuples. Optional but improves robustness.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rs/moq-relay/src/cluster.rs(4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
rs/moq-relay/**
📄 CodeRabbit inference engine (CLAUDE.md)
In the CDN/relay (moq-relay), do not include application logic, media codecs, or track-specific details; keep it transport-agnostic.
Files:
rs/moq-relay/src/cluster.rs
rs/**/src/**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
Write Rust tests integrated within source files (unit tests alongside code).
Files:
rs/moq-relay/src/cluster.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Check
🔇 Additional comments (2)
rs/moq-relay/src/cluster.rs (2)
121-127: Leaf announcement gating onnodeis appropriate.Only advertise when we’re connecting to a root and have a
nodevalue. The log context includesprefixandmyself, which is useful for tracing.
189-190: Correct self-skip in discovery.The
Option<&str>comparison againstself.config.node.as_deref()cleanly filters our own origin. LGTM.
Summary by CodeRabbit