-
Notifications
You must be signed in to change notification settings - Fork 35
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
Remove context transformers. Add provider hooks #119
Conversation
64a00cc
to
8fcc213
Compare
a757e09
to
cc2534a
Compare
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.
LGTM
Hey @justinabrahms, could you please signoff your commit? |
9646ff7
to
aebcd5f
Compare
Signed-off-by: Justin Abrahms <[email protected]>
aebcd5f
to
678e492
Compare
Signed off again. |
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.
I think we need to modify 4.4.1 to include provider hooks... (Also, I'm not sure what it's trying to say when it mentions flag evaluation options)
Added a few other comments elsewhere.
c0c3f8f
to
f25fda0
Compare
Provider interface must add hook mechanism. Make wording clearer. Ensure Provider is listed alongside other hook registrars. Signed-off-by: Justin Abrahms <[email protected]>
f25fda0
to
946be25
Compare
So we are now adding support for provider hooks which appears to call Would this also remove these provider hooks or only the user added hooks? Or is my assumption incorrect that the My concern if you have these provider hooks e.g. to cherry pick some elements from the evaluation context so it can be used in the provider when resolving a feature flag and someone calls |
@weyert Great call out. I would expect that this wouldn't remove provider hooks, which may be necessary for a provider to function. Does that make sense to you? |
What is the use case of removing Provider hook? This hook is optionally supplied by the Provider and the app developer has no knowledge of it. Certain default features carried out by provider hook can be overridden by the app developer using hook hints if the provider chooses to document such option. But clear hook operation initiated by the app developer should not remove provider hooks. |
It seems like we've basically identified application author-facing hooks and provider hooks. The clear hooks method is meant for the application author and probably shouldn't impact the provider hooks which the application author isn't aware of... I'm not sure the clear hooks method is even in the spec (which IMO is fine). Because it's not spec'd I don't think we need to add this edge case to the spec about not removing provider hooks when it's called. Please correct me if I'm wrong. |
Hey @justinabrahms, we should be good to merge this PR once all conversations have been resolved. Once this is merged, I plan on releasing v0.2.0. |
f9addea
to
5de196f
Compare
Co-authored-by: Todd Baert <[email protected]> Signed-off-by: Justin Abrahms <[email protected]>
5de196f
to
9bc54eb
Compare
I'm late to the party here (I was off on holiday).
When talking about context transformation, why are we recommending that it is done via a hook? Why not just recommend having the provider layer do the transformation within the Flag Evaluation stage? As I understand it, the vender-specific format of the evaluation context is only needed by the vendor's SDK. As such, it (IMO) should be encapsulated within the provider layer. By transforming the context as a hook, we are introducing encapsulation leakage and passing the transformed context back to the OpenFeature SDK (only for it to be passed back into the provider layer by the flag evaluation stage). Would it not be simpler (and better encapsulated) to leave the context transformation entirely within the flag evaluation stage of the provider? WRT to the original messages on Slack about adding a provider hook to allow setting additional parameters to the context so that they can be logged by OpenTelemetry - that makes perfect sense and it's a good idea to add the vendor hooks as stated. I'm just thinking that it's better to recommend transforming the context as part of the provider's Flag Evaluation stage rather than a hook. @justinabrahms @beeme1mr , thoughts? |
Additionally, I think it would be better to change the If we change it to |
This is a good observation, and I think I agree with your conclusion, and discussions yesterday with @beeme1mr and @justinabrahms kinda elucidated the same problem. I think we can keep the ordering as is, since provider-related side effects should happen as close to the provider as possible, but we should remove the additional recommendation that context transformation be done in hooks.
Sounds like we're on the same page. |
In java, we're just providing a default noop implementation as part of the interface. I don't feel strongly on this wording. |
#129 Here is the wording change, as well as a removal of the entire |
refs open-feature/ofep#22