-
Notifications
You must be signed in to change notification settings - Fork 39
Write assertions in batches #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis PR addresses a limitation where importing store files with more than 100 assertions would fail. The changes implement batching of assertion imports in groups of 100, precompute total assertion counts for efficient slice allocation, introduce comprehensive test coverage for batching behavior, and apply performance-oriented slice preallocation optimizations across test utilities. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 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. 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 |
rhamzeh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work as you'd expect - the API accepts a max of 100 assertions: https://github.com/openfga/api/blob/main/openfga/v1/openfga_service.proto#L1639-L1650
Every following WriteAssertions request will just override what came before it.
…ing a warning instead
Description
What problem is being solved?
Fixes #618
How is it being solved?
It batches assertions in groups of 100.
What changes are made to solve it?
References
Review Checklist
mainSummary by CodeRabbit
New Features
Tests
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.