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
Adds exclude logic to Targeting and Audience, adds unit test, updates example to include exclude #218
Conversation
I should call out I went with the wording "Exclude" rather than "Except". Using Except/Exception in the code was not very clear. If we still want the field named Except, we can do that. |
src/Microsoft.FeatureManagement/Targeting/ContextualTargetingFilter.cs
Outdated
Show resolved
Hide resolved
611646a
to
990367e
Compare
I like it. I was thinking about it too. "Exclude" is a verb, a little bit weird as a property name. Do we like to use a noun, "Exclusion", instead? |
Also offering that symmetry with existing name in the configuration, |
Honestly speaking, "except" works better with "enabledFor". I think that's the reason we picked the "except" in the first place. I am just concerned we may over complicate the design. If we choose to use "Exclusion" for the AppConfig schema, we might just use the same everywhere else. It will make the tooling work easier. |
You lost me here. What are you referring to as the AppConfig schema? and what are you referring to as everywhere else? From my thinking, AppConfig schema plays no role in the decision here. This name will only show up in the targeting configuration which is AppConfig agnostic. |
Agreed- I also prefer All of that said- I think I'll move forward with |
Synced with Jimmy- We aligned on In this context, we're just defining an Audience (not a feature flag). Except is clearly calling out that the audience is as defined- except for these users/groups. Also calling out that this field is the only place this idea of Except/Exclude/Exclusion exists. It's on the Audience object- so it will be seen in both the backend and FeatureManagement schemas, but there's no other uses of this word yet. Not going to merge until we hear sign-off from you as well @zhenlan , but for now I'll go ahead and make the code changes towards "Except". *Update - We've aligned back on |
990367e
to
faadfd7
Compare
Changed the naming to |
src/Microsoft.FeatureManagement/Targeting/ContextualTargetingFilter.cs
Outdated
Show resolved
Hide resolved
… example to include exclusion
faadfd7
to
2f5a171
Compare
In response to #123.
Adds Exclusion to Audience
Audiences have historically been a list of users, groups, and rollout percentages. This change adds an additional field in Audience called Exclusion. This field holds a list of Users and Groups. These users and groups are evaluated before the rest of the Audience. If there is a match, the feature flag immediately returns false.
If the targeting filter has sibling filters, they will still be evaluated after a false result.
Example
appsettings.json
Evaluation