Repository navigation
feat: merge equivalent checks in BatchCheck (beta) - #334
Draft
Siddhant-K-code wants to merge 3 commits into
Draft
Siddhant-K-code wants to merge 3 commits into
Siddhant-K-code wants to merge 3 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (72.32%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #334 +/- ##
==========================================
+ Coverage 69.99% 72.32% +2.33%
==========================================
Files 142 144 +2
Lines 10774 11196 +422
==========================================
+ Hits 7541 8098 +557
+ Misses 3233 3098 -135 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Reject a non-bool merge_equivalent_checks value instead of silently leaving merging off. - Use fullmatch for correlation IDs so a trailing newline is rejected. - Test that the model read carries the caller's headers. - README: clarify the model cache is per model.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an opt-in
merge_equivalent_checksoption tobatch_check(beta). When it's on, checks that are certain to get the same answer are sent once, and the answer is copied back to each of them.Description
What problem is being solved?
A
batch_checkoften asks the same question more than once. It might check an alias likedefine can_view: viewernext toviewer, or repeat the same check. Each one is sent and evaluated separately, which costs server work and request size and gives no new information.How is it being solved?
With
merge_equivalent_checkson, the SDK:You still get one result per check you passed in. With the option off, nothing changes.
What merges
can_share: can_view→can_view: viewer.If the SDK can't be sure two checks match, it sends them separately.
Rules
merge_equivalent_checksmust beTrueorFalse. Any other value fails validation, so a typo can't silently leave it off.^[\w\d-]{1,36}$. Missing ones are generated. Duplicates are rejected.What changes are made to solve it?
batch_check, pluschecks_senton the response.fga-client.batch_check.checks_requestedfga-client.batch_check.checks_sentfga-client.batch_check.merge_fallbackfga-client.model_cache.lookup, with a newfga-client.model_cache.resultattribute (hit/miss)docs/opentelemetry.md.test/data/and pinned to5afcf70. To refresh them, runmake update-equivalent-checks-cases LANGUAGE_REF=<ref>.References
Notes for reviewers
Review Checklist
main