fix(mcp): нормализовать root-uri через Absolute.uri#4119
Conversation
|
Warning Review limit reached
More reviews will be available in 8 minutes and 52 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesMCP Root URI Conversion
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
| private static @Nullable Path toPath(Root root) { | ||
| try { | ||
| return Path.of(URI.create(root.uri())); | ||
| return Path.of(Absolute.uri(root.uri())); |
There was a problem hiding this comment.
Да, так чище — Absolute.path(String) отдаёт нормализованный Path напрямую. Заменил Path.of(Absolute.uri(root.uri())) → Absolute.path(root.uri()).
There was a problem hiding this comment.
Поправка к ответу выше: чистый Absolute.path(root.uri()) не подошёл — перегрузка path(String) трактует строку как файловый путь, а у нас root.uri() это URI-строка (file://…), плюс она не отбраковывает не-file URI (так ломались 2 теста: unsupportedRootUriIsSkipped, mcpRootsRegisterAndRemoveWorkspaces). Корректная форма через Absolute.path — с URI-перегрузкой: Absolute.path(Absolute.uri(root.uri())) (строка → нормализованный URI → Path). Сборка и MCP-тесты зелёные.
0996ca9 to
44f8047
Compare
Co-Authored-By: Claude Fable 5 <[email protected]>
44f8047 to
a0026d5
Compare
|



McpRootsChangeConsumer.toPathстроилPathизURI.create(root.uri()). По соглашению проекта URI всегда нормализуем черезAbsolute.uri(...)(а неURI.create), чтобы пути из разных источников совпадали. Заменил наPath.of(Absolute.uri(root.uri())), убрал неиспользуемый импортjava.net.URI.🤖 Generated with Claude Code
Summary by CodeRabbit