Skip to content
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

Pass FeatureFilterEvaluationContext in ITargetingContextAccessor implementation #193

Open
sacrajit opened this issue Aug 17, 2022 · 3 comments

Comments

@sacrajit
Copy link

While using the library I ran into scenarios where the targeting context can be different for different features and having the feature definition allows the implementation to take decision based on feature being evaluated.
Please consider this as a new feature in your upcoming release.
Thanks!

@zhiyuanliang-ms
Copy link
Contributor

zhiyuanliang-ms commented Sep 8, 2023

Hi, @sacrajit
Could you give more details about the scenario you've mentioned?
Currently, if you want to use targeting filter, you need to implement ITargetingContextAccessor by yourself.
The targeting filter has a property ITargetingContextAccessor _contextAccessor, which will be injected.
If my understanding is correct, you scenario can be solved by setting different targeting filters for different feature flags and assigning different groups which are used by different targeting filters of different feature flags.
There will be a long "groups" in a user's targetingContext, which contains different groups for different targeting filter. The targeting filters of feature flags will only consider the desired group and igore other unrelated group.
Basically, you assign a comprehensive targetingContext for targeting filters of different feature flags, instead of assigning different targeting context for different feature flag.

For example, if you want the targeting context for feature flag A to use group "A-1", "A-2", "A-3"... and feature flag B to use group "B-1", "B-2", "B-3"...
You can assign the user with the targeting context where the "groups" property is ["A-1", "B-1"]
The targeting filter of feature A will only recognize the group "A-1" and the targeting filter of feature A will only recognize the group "B-1".
Can this be a workaround solution for you?

@rossgrambo
Copy link
Contributor

We might be able to add something to support that workaround, but I don't think implementations of ITargetingContextAccessor have knowledge of which feature is being evaluated.

@zhiyuanliang-ms
Copy link
Contributor

zhiyuanliang-ms commented Oct 16, 2023

Hi, @sacrajit
Do you think this proposal #282 can be helpful for your scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants