-
Notifications
You must be signed in to change notification settings - Fork 3
feat: evaluation engine #183
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
Merged
Merged
Conversation
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
This commit adds new `EvaluationReason` constructors used within the evaluation engine.
Adds `<`, `>`, `<=`, and `>=` to `Value`. These are used within rule match logic in the evaluation engine. Non-numbers always return false.
Adds the ability to parse timestamps from string or numeric `Value`s. This uses the same RFC3339 parser from the C Server SDK, so results should be consistent.
Adds a new `sha1` hash function, implemented similar to the existing `sha256`. Moved the hex encoding routine from sha256's tests into a dedicated header so it can be reused in sha1's tests or elsewhere.
Adds a `SemVer` class to perform semantic version parsing. This is implemented natively instead of pulling a 3rd party dependency like C Server mainly because string manipulation is doable in C++, and because we have to patch those libraries anyways (to accept omitted minor/patch versions.)
Adds a data structure for detecting circular references during evaluation. It is called `EvaluationStack` and uses RAII to notice/forget keys.
Adds bucketing logic to be used in evaluation engine. Buckets are computed based on a hash value comprised of context attributes and prefixes derived from flag rules.
This PR contains the main evaluation engine and associated tests.
kinyoklion
approved these changes
Jul 18, 2023
Removes potentially costly, unecessary copies of `Value` in the evaluation algorithm.
…e implementations
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.
This is the main feature branch for the evaluation engine. All pieces have been reviewed individually.
Perhaps due to Github rate limiting, not all lints are showing up in the UI - so I'll address them as they appear until I hit diminishing returns.