-
Notifications
You must be signed in to change notification settings - Fork 22
feat: Add evaluation details to finally hook stage #335
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
Conversation
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #335 +/- ##
=======================================
Coverage ? 85.13%
=======================================
Files ? 36
Lines ? 1480
Branches ? 151
=======================================
Hits ? 1260
Misses ? 188
Partials ? 32 ☔ View full report in Codecov by Sentry. |
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
beeme1mr
left a comment
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 <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
|
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 |
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com> Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [2.3.0](v2.2.0...v2.3.0) (2025-01-31) ### ⚠ BREAKING CHANGES #### Hook Changes The signature of the `finally` hook stage has been changed. The signature now includes the `evaluation details`, as per the [OpenFeature specification](https://openfeature.dev/specification/sections/hooks#requirement-438). Note that since hooks are still `experimental,` this does not constitute a change requiring a new major version. To migrate, update any hook that implements the `finally` stage to accept `evaluation details` as the second argument. * Add evaluation details to finally hook stage ([#335](#335)) ([2ef9955](2ef9955)) #### .NET 6 Removed support for .NET 6. * add dotnet 9 support, rm dotnet 6 ([#317](#317)) ([2774b0d](2774b0d)) ### 🐛 Bug Fixes * Adding Async Lifetime method to fix flaky unit tests ([#333](#333)) ([e14ab39](e14ab39)) * Fix issue with DI documentation ([#350](#350)) ([728ae47](728ae47)) ### ✨ New Features * add dotnet 9 support, rm dotnet 6 ([#317](#317)) ([2774b0d](2774b0d)) * Add evaluation details to finally hook stage ([#335](#335)) ([2ef9955](2ef9955)) * Implement Default Logging Hook ([#308](#308)) ([7013e95](7013e95)) * Implement transaction context ([#312](#312)) ([1b5a0a9](1b5a0a9)) ### 🧹 Chore * **deps:** update actions/upload-artifact action to v4.5.0 ([#332](#332)) ([fd68cb0](fd68cb0)) * **deps:** update codecov/codecov-action action to v5 ([#316](#316)) ([6c4cd02](6c4cd02)) * **deps:** update codecov/codecov-action action to v5.1.2 ([#334](#334)) ([b9ebddf](b9ebddf)) * **deps:** update codecov/codecov-action action to v5.3.1 ([#355](#355)) ([1e8ebc4](1e8ebc4)) * **deps:** update dependency coverlet.collector to 6.0.3 ([#336](#336)) ([8527b03](8527b03)) * **deps:** update dependency coverlet.msbuild to 6.0.3 ([#337](#337)) ([26fd235](26fd235)) * **deps:** update dependency dotnet-sdk to v9.0.101 ([#339](#339)) ([dd26ad6](dd26ad6)) * **deps:** update dependency fluentassertions to 7.1.0 ([#346](#346)) ([dd1c8e4](dd1c8e4)) * **deps:** update dependency microsoft.net.test.sdk to 17.12.0 ([#322](#322)) ([6f5b049](6f5b049)) ### 📚 Documentation * disable space in link text lint rule ([#329](#329)) ([583b2a9](583b2a9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: Todd Baert <todd.baert@dynatrace.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
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
FlagEvaluationDetailsas a parameter, updating theEvaluateFlagAsyncmethod 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 theFinallyAsyncmethods to acceptFlagEvaluationDetailsas 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 theEvaluateFlagAsyncmethod to initializeFlagEvaluationDetailsin case of provider errors and ensure theFinallyAsynchook is always called with the correct evaluation details. [1] [2] [3]