fix(network-segment): make dual-stack metrics deterministic - #5632
fix(network-segment): make dual-stack metrics deterministic#5632pbreton wants to merge 1 commit into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
@coderabbitai full review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. Summary by CodeRabbit
WalkthroughThe handler now selects an IPv4 prefix for network-segment metrics when available. IPv6-only segments use their first prefix. Tests cover dual-stack prefix order and IPv6 fallback. ChangesNetwork-segment metrics
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change makes compatibility metrics deterministic while preserving the existing metric interface. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai full review. |
|
✅ Action performedFull review finished. |
|
✅ Action performedFull review finished. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Signed-off-by: Patrice Breton <pbreton@nvidia.com>
|
🌿 Preview your docs: https://nvidia-preview-pull-request-5632.docs.buildwithfern.com/infra-controller |
Summary
Network-segment compatibility metrics expose one prefix per segment. The controller selected
prefixes[0], but database prefix aggregation does not guarantee row order, so a dual-stack segment could alternate between IPv4 and IPv6 labels and counts.This change explicitly prefers the IPv4 prefix for the existing compatibility series and retains the IPv6 prefix for IPv6-only segments. Metric names and label names remain unchanged.
Related issues
Fixes #5402.
Type of Change
Breaking Changes
Testing
Validation performed:
cargo test -p carbide-network-segment-controllercargo clippy -p carbide-network-segment-controller --all-targets --all-features -- -D warningscargo +nightly fmt --all -- --checkcargo check -p carbide-api-core --lib --no-default-featuresgit diff --checkThe reversed-prefix regression was confirmed to fail before the fix and pass afterward.
Additional Notes
This is an attempt at fully automated issue resolution using Codex.