-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Add support for hook data. #387
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #387 +/- ##
==========================================
+ Coverage 85.69% 86.47% +0.77%
==========================================
Files 39 42 +3
Lines 1601 1671 +70
Branches 171 177 +6
==========================================
+ Hits 1372 1445 +73
+ Misses 191 187 -4
- Partials 38 39 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1264589 to
7b827b7
Compare
0af05fd to
04b20c6
Compare
Signed-off-by: Ryan Lamb <[email protected]>
04b20c6 to
a8a7f59
Compare
|
Hey @kinyoklion, thanks for kicking this off. I'll cut some GitHub issues for other languages once this PR is ready so we can use this as a reference. |
Co-authored-by: chrfwow <[email protected]> Signed-off-by: Ryan Lamb <[email protected]>
Signed-off-by: Ryan Lamb <[email protected]>
Signed-off-by: Ryan Lamb <[email protected]>
|
@toddbaert I would like to get your thoughts on the spec divergence in the description. If we are in agreement I can make a minor change to the spec wording. |
@kinyoklion I agree with your assertion that allowing any object is relatively safe in this case, and certainly more ergonomic. I think we should adjust the spec accordingly. |
Signed-off-by: Ryan Lamb <[email protected]>
Signed-off-by: Ryan Lamb <[email protected]>
This PR
Adds support for hook data.
open-feature/spec#273
Related Issues
Notes
I realized that the 4.6.1 section of the spec wasn't consistent with the expected usage. Basically it over-specifies the typing of the hook data matching that of the evaluation context. That is one possible approach, it would just mean a bit more work on the part of the hook implementers.
In the earlier example in the spec I put a
Spanin the hook data:This is only possible if the hook data allows specification of any
objectinstead of being limited to the immutable types of a context. For hooks hook data this is safe because only the hook mutating the data will have access to that data. Additionally the execution of the hook will be in sequence with the evaluation (likely in a single thread).The alternative would be to store data in the hook, and use the hook data to know when to remove it.
Something like this:
Follow-up Tasks
How to test