-
Notifications
You must be signed in to change notification settings - Fork 164
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
Ignore cycle errors in union reducer #1371
Merged
Merged
Conversation
This file contains 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
jon-whit
reviewed
Feb 15, 2024
Co-authored-by: Jonathan Whitaker <jon.b.whitaker@gmail.com>
jon-whit
reviewed
Feb 15, 2024
jon-whit
reviewed
Feb 15, 2024
Co-authored-by: Jonathan Whitaker <jon.b.whitaker@gmail.com>
jon-whit
reviewed
Feb 16, 2024
@willvedd I know it's verbose and ugly, but can we explicit use |
jon-whit
reviewed
Feb 16, 2024
jon-whit
reviewed
Feb 16, 2024
jon-whit
reviewed
Feb 16, 2024
jon-whit
reviewed
Feb 16, 2024
4 tasks
willvedd
commented
Feb 16, 2024
willvedd
commented
Feb 16, 2024
miparnisari
reviewed
Feb 16, 2024
…/openfga/openfga into union-reducer-ignore-cycle-error
4 tasks
miparnisari
reviewed
Feb 16, 2024
Co-authored-by: Maria Ines Parnisari <maria.inesparnisari@okta.com>
jon-whit
reviewed
Feb 16, 2024
…/openfga/openfga into union-reducer-ignore-cycle-error
jon-whit
previously approved these changes
Feb 16, 2024
jon-whit
reviewed
Feb 16, 2024
jon-whit
approved these changes
Feb 16, 2024
This was referenced Feb 16, 2024
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.
Description
The
union()
function is a reducer that accepts any number of handlers and makes a check decision based on the combination of all those reducers. It is how the union operator is implemented in models with theor
syntax.Generally, if one or more handler within the reducer is truthy, the whole evaluation returns true. If all handlers are falsey, then the union reducer will return false. Errors generally override any truthy or falsey resolution. If one handler errors for any reason, even if other handlers are truthy, the reducer will return that error.
However, the
ErrCycleDetected
is not an error that should be considered a critical error. It should be considered the same as a falsey result because it signals that a resolution branch was exhausted without any truthy result. Ignoring this error within the union reducer will result in a more correct and fault-tolerant check resolution.**Note: ** Similar changes may need to be made in the intersection and exclusion reducers. This PR is meant to serve as a starting point for those conversations.
Review Checklist
main