chore: Remove JSON-RPC static processor wrapper#1558
Conversation
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe static ChangesJsonRpcProcessor to JsonRpcRequestProcessor Migration
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Poem 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Construct JsonRpcRequestProcessor with local registrar services in the JSON-RPC tests so they no longer depend on ApplicationRegistrar.Service. Keep the assertions and async coordination patterns intact while preserving the registrar facade for extension API coverage.
Remove the compatibility wrapper once the tests use injected JsonRpcRequestProcessor instances and the scanner shows no production dependency. Update the IPC reminder fixture and pin-reader comment to reference the remaining request processor file.
199ad68 to
57bfe15
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs (1)
176-191: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a shared helper for the repeated registrar+tool+processor setup.
The
CreateRegistrarService()→service.RegisterCustomTool(...)→CreateProcessor(service)sequence is repeated across ~8 test methods. A small overload likeCreateProcessor(IUnityCliLoopTool tool)would collapse this into a one-liner per test.♻️ Example helper
+ private static JsonRpcRequestProcessor CreateProcessor(IUnityCliLoopTool customTool) + { + UnityCliLoopToolRegistrarService service = CreateRegistrarService(); + service.RegisterCustomTool(customTool); + return CreateProcessor(service); + }Also applies to: 226-251, 284-306, 308-330, 332-357, 359-384, 386-410, 509-522, 551-567
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs` around lines 176 - 191, The registrar/tool/processor setup is duplicated across multiple tests, so add a shared helper to centralize it. Introduce an overload like CreateProcessor(IUnityCliLoopTool tool) or a similarly named helper that calls CreateRegistrarService(), RegisterCustomTool(...), and CreateProcessor(service) in one place, then update the affected tests (including the SingleFlightTestTool cases) to use it instead of repeating the sequence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs`:
- Around line 176-191: The registrar/tool/processor setup is duplicated across
multiple tests, so add a shared helper to centralize it. Introduce an overload
like CreateProcessor(IUnityCliLoopTool tool) or a similarly named helper that
calls CreateRegistrarService(), RegisterCustomTool(...), and
CreateProcessor(service) in one place, then update the affected tests (including
the SingleFlightTestTool cases) to use it instead of repeating the sequence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 833e8560-4655-4dfd-a64d-0b04f2a22ab7
⛔ Files ignored due to path filters (2)
Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs.metais excluded by none and included by nonePackages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs.metais excluded by none and included by none
📒 Files selected for processing (5)
Assets/Tests/Editor/JsonRpcHeartbeatTests.csAssets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.csPackages/src/Editor/Infrastructure/Api/JsonRpcProcessor.csPackages/src/Editor/Infrastructure/CLI/CliPinReaderService.cscli/release-automation/internal/automation/ipc_protocol_reminder_test.go
💤 Files with no reviewable changes (1)
- Packages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs
Remove the overloaded test helper shape and update remaining JSON-RPC log tags to the surviving request processor name after deleting the static wrapper.
Summary
JsonRpcRequestProcessorwith injected registrar services instead of using theJsonRpcProcessorstatic compatibility wrapperJsonRpcProcessor.csand preserve the extension-facingUnityCliLoopToolRegistrarfacade for CompositionRoot and public registrar APIsJsonRpcRequestProcessorVerification
dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)"-> 0 errors / 0 warningsJsonRpcRequestProcessorCliVersionGateTests|JsonRpcHeartbeatTests|StaticFacadeStateGuardTests|UnityCliLoopToolRegistryTests|OnionAssemblyDependencyTests-> 153/153 passedJsonRpcProcessortype remains; only JsonRpcRequestProcessor DTO reflection keeps reportedJsonRpcProcessor.cs,static class JsonRpcProcessor, orJsonRpcProcessor.references remainscripts/check-go-cli.sh-> passedNotes
ApplicationRegistrar.Serviceusage is removed from JSON-RPC tests; the registrar facade remains intentionally covered byUnityCliLoopToolRegistryTestsand registered from CompositionRoot.