-
Notifications
You must be signed in to change notification settings - Fork 22
fix: Address issues when evaluating the context in the InMemoryProvider #615
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
Conversation
Signed-off-by: Kyle Julian <[email protected]>
|
/gemini review |
Summary of ChangesHello @kylejuliandev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness of the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #615 +/- ##
==========================================
+ Coverage 89.84% 89.89% +0.04%
==========================================
Files 77 77
Lines 3162 3167 +5
Branches 364 364
==========================================
+ Hits 2841 2847 +6
Misses 251 251
+ Partials 70 69 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Code Review
This pull request correctly addresses issues in the InMemoryProvider by falling back to the default variant when context evaluation fails or returns a non-existent variant. The logic is sound and aligns with the behavior of other OpenFeature SDKs. The changes are accompanied by relevant tests. I've included a few suggestions to enhance code readability and improve the completeness of the tests.
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.
Code Review
This pull request correctly addresses issues in the InMemoryProvider's context evaluation. When the context evaluator throws an exception or when an evaluated variant doesn't exist, the provider now falls back to the default variant, which aligns with the OpenFeature specification. The changes are logical, and the addition of new tests ensures the new behavior is covered. I have one minor suggestion to improve code readability.
Signed-off-by: Kyle Julian <[email protected]>
Signed-off-by: Kyle Julian <[email protected]>
This PR
Fixes a couple of issues when the
InMemoryProvidercannot evaluate the variant. First when the variant does not exist, we should fallback to the default variant configured in the flags. Second when the ContextEvaluator throws an exception. Instead of throwing an error we can fallback to the default variant. This is the behaviour in the Java SDK, as well as behaviour described in the gherkin tests. Specifically, the Null context values scenario and the Empty evaluation context scenario.Related Issues
Fixes #603
Notes
Follow-up Tasks
How to test