refactor: address all open Sonar findings - #1179
Conversation
Signed-off-by: Will Killian <wkillian@nvidia.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/NeMo-Relay/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (18)
🧰 Additional context used📓 Path-based instructions (3)Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.⚙️ CodeRabbit configuration file Files:
Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.⚙️ CodeRabbit configuration file Files:
Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.⚙️ CodeRabbit configuration file Files:
🔇 Additional comments (5)
WalkthroughThe changes extract existing disconnect cleanup, worker launch supervision, plugin interceptor registration, and test codec validation logic into private helpers. The summaries report that the existing interceptor paths and disconnect cleanup behavior are retained. ChangesPeer disconnect expiry
Worker launch supervision
Native plugin fixture registration
Go execution test codec checks
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established; the change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
mnajafian-nv
left a comment
There was a problem hiding this comment.
Lgtm, no p0s or p1s found.
|
/merge |
Overview
Address all four open Sonar findings on upstream
mainby reducing cognitive complexity without changing behavior. The Sonar MCP inventory and project measures report four code smells, zero bugs, zero vulnerabilities, and zero security hotspots.Details
disconnectedincrates/cli/src/daemon/broker/server/socket.rs(rust:S3776, previously 26).supervise_routeincrates/cli/src/daemon/mcp/mod.rs(rust:S3776, previously 32), preserving failure reporting, registration refresh, and pending-child cleanup.crates/core/tests/fixtures/native_plugin/src/lib.rs(rust:S3776, previously 30), preserving registration order and scoped, isolated, and concurrent delegation.TestLlmExecutionInterceptResolvesDirectionalCodecsingo/nemo_relay/llm_test.go(go:S3776, previously 26), preserving codec lifetime assertions.No public API changes or Sonar suppressions.
Validation:
sdk_cdylib_registers_tool_request_intercepttest, and the focused Go directional codec test.just build-test-plugin-fixtures,just ci=true test-go, and stageduv run pre-commit run(including Clippy, Rust checks, Go vet, formatting, and link checks). Commit hooks also passed.just test-rust: 5,439 passed and 38 failed in configuration/plugin-policy tests on this host, which has/etc/nemo-relay/plugins.toml. Interrupted afterffi_activation_explicit_config_replaces_discovered_user_configstalled for over three minutes; 88 tests were not completed, and the recipe did not reach its example suites. The daemon tests and native fixture behavior tests passed.Where should the reviewer start?
Start with
supervise_worker_launchincrates/cli/src/daemon/mcp/mod.rsand verify that each worker failure still refreshes registration before the route loop continues. Then reviewexpire_disconnected_peerfor unchanged transaction ownership and generation checks.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
Refactor
Tests