-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: Add evaluation details to finally hook stage #335
base: main
Are you sure you want to change the base?
feat: Add evaluation details to finally hook stage #335
Conversation
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #335 +/- ##
==========================================
- Coverage 85.17% 85.13% -0.04%
==========================================
Files 36 36
Lines 1477 1480 +3
Branches 150 151 +1
==========================================
+ Hits 1258 1260 +2
Misses 188 188
- Partials 31 32 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: André Silva <[email protected]>
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.
Could you please add a test to ensure that the evaluation details included in the final stage match what's returned to the user? Here's how requirement 4.3.8 was tested in JS.
Thank!
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Will merge/release this next week unless I hear objections. We'll have to do some manual release notes as well when we do, as we did with JS: https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.4.0 See also, same change in Java: open-feature/java-sdk#1262 |
Add evaluation details to the finally hook stage
This pull request includes several changes to improve the handling of flag evaluation details and error handling in the OpenFeature library. The most important changes include modifying hook methods to accept
FlagEvaluationDetails
as a parameter, updating theEvaluateFlagAsync
method to handle provider errors more gracefully, and adjusting the corresponding unit tests to reflect these changes.Related Issues
Fixes #328
Notes
Improvements to Hook Methods:
src/OpenFeature/Hook.cs
: Modified theFinallyAsync
methods to acceptFlagEvaluationDetails
as a parameter. [1]src/OpenFeature/Hook.cs
: Modified the hooks methods to split the parameters per line.[1] [2] [3]Enhancements to Flag Evaluation:
src/OpenFeature/OpenFeatureClient.cs
: Updated theEvaluateFlagAsync
method to initializeFlagEvaluationDetails
in case of provider errors and ensure theFinallyAsync
hook is always called with the correct evaluation details. [1] [2] [3]