Skip to content

fix(spicedb): migrate batch check to the stable bulk permissions API#1777

Open
AmanGIT07 wants to merge 2 commits into
mainfrom
fix/spicedb-bulk-check-migration
Open

fix(spicedb): migrate batch check to the stable bulk permissions API#1777
AmanGIT07 wants to merge 2 commits into
mainfrom
fix/spicedb-bulk-check-migration

Conversation

@AmanGIT07

@AmanGIT07 AmanGIT07 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Move the SpiceDB integration off the experimental API surface. The batch check migrates from the deprecated BulkCheckPermission to the stable CheckBulkPermissions, and the client no longer requests experimental APIs since nothing uses them afterwards.

Changes

  • internal/store/spicedb/relation_repository.go (BatchCheck): rename the request, item, and pair types and the client method to their stable names. Same fields, same accessors, no logic change.
  • internal/store/spicedb/spicedb.go: construct the client with authzed.NewClient and hold *authzed.Client instead of the experimental variant. Same dial options.

Technical Details

The stable API is available in the already-pinned authzed-go version; no dependency change. The stable response guarantees pairs in request order, which the result indexing relies on.

Test Plan

  • Build and type checking passes
  • PAT e2e regression suite passes against real SpiceDB, including the batch-check mixed-results case, with the client constructed through NewClient

BulkCheckPermission is deprecated in authzed-go and slated for removal.
The stable CheckBulkPermissions API has the same shape and is available
in the pinned version, so this is a pure rename.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Jul 20, 2026 12:59pm

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 670ac429-ee5d-4871-844b-6f7ae315b5d4

📥 Commits

Reviewing files that changed from the base of the PR and between 4ab6596 and 326595a.

📒 Files selected for processing (1)
  • internal/store/spicedb/spicedb.go

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Updated bulk permission checking to use the latest authorization service request types and client method.
    • Preserved existing permission result assembly, per-item error handling, and caching behavior.
    • Switched the Authzed client used by the SpiceDB integration to the non-experimental client while keeping the same connection and startup checks.

Walkthrough

Changes

SpiceDB bulk permission checks

Layer / File(s) Summary
Migrate SpiceDB client initialization
internal/store/spicedb/spicedb.go
SpiceDB now stores a standard Authzed client and constructs it with authzed.NewClient, retaining the existing connection options and error handling.
Update bulk check request construction
internal/store/spicedb/relation_repository.go
BatchCheck now builds CheckBulkPermissionsRequestItem values, wraps them in CheckBulkPermissionsRequest, and calls CheckBulkPermissions while retaining existing consistency and result handling.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ravisuhag

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

coveralls commented Jul 20, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29744337323

Coverage remained the same at 46.11%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 5 uncovered changes across 2 files (0 of 5 lines covered, 0.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
internal/store/spicedb/relation_repository.go 4 0 0.0%
internal/store/spicedb/spicedb.go 1 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 38321
Covered Lines: 17670
Line Coverage: 46.11%
Coverage Strength: 13.32 hits per line

💛 - Coveralls

Nothing uses the experimental service after the batch check migration,
so hold a plain client. Same options, no other change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
func (r *RelationRepository) BatchCheck(ctx context.Context, relations []relation.Relation) ([]relation.CheckPair, error) {
result := make([]relation.CheckPair, len(relations))
items := make([]*authzedpb.BulkCheckPermissionRequestItem, 0, len(relations))
items := make([]*authzedpb.CheckBulkPermissionsRequestItem, 0, len(relations))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tested this with currently default set version of spicedb in the docker as well as k8s charts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants