feat(a2a-nats): add live bulk-import permission client - #432
Conversation
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 0498b08. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Warning Review limit reached
More reviews will be available in 44 minutes and 35 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 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 credits. 🚦 How do rate 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 see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughAdds ChangesSpiceDB Live Client
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Code Coverage SummaryDetailsDiff against mainResults for commit: 0498b08 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
…ient Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@rsworkspace/crates/a2a-nats/src/catalog/import_gate/spicedb/client.rs`:
- Around line 73-85: In connect, the endpoint string parsing done by
Channel::from_shared should be treated as a local config validation error and
mapped to SpiceDbImportGateBuildError::InvalidEndpoint rather than Connect, and
the bearer token metadata creation should happen before calling .connect().await
so MetadataValue::try_from failures are reported as InvalidToken before any
transport dialing. Update the error mapping in client::connect to keep URI parse
failures and token parse failures separate from the network connection path.
- Around line 93-116: `LiveBulkImportPermissionClient` is still converting tonic
responses into plain bodies via `into_inner()` in `check_bulk_permissions` and
`write_relationships`, which breaks the SDK passthrough. Update
`BulkImportPermissionCheck` so both methods return `tonic::Response<_>` directly
from the inner client, and move the body extraction to `SpiceDbImportGate` where
only the message payload is needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 14f00a79-dcea-4572-8ac3-500ba6d837e0
📒 Files selected for processing (4)
rsworkspace/crates/a2a-nats/src/catalog/import_gate/mod.rsrsworkspace/crates/a2a-nats/src/catalog/import_gate/spicedb/client.rsrsworkspace/crates/a2a-nats/src/catalog/import_gate/spicedb/client/tests.rsrsworkspace/crates/a2a-nats/src/catalog/import_gate/spicedb/mod.rs
…before dial, return tonic::Response Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
LiveSpiceDbTier1Gate(a2a-gateway) andLiveAgentViewGate(a2a-nats) from having to ship their own tonic-channel wiring.