-
Notifications
You must be signed in to change notification settings - Fork 114
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
Consider the ability to allocate variants based on custom filters #460
Comments
It's an interesting idea. With your suggestion, what would you expect the interface of "CustomFilter" to look like? |
@jimmyca15 - I haven't gone too deep on the allocation code after I saw it was all private and I couldn't extend it myself. Could it be as simple as: public interface IContextualVariantFeatureFilter<TContext> : IContextualFeatureFilter<TContext> {
string Variant { get; set; }
} |
Hi, @CuddleBunny Thank you for your suggestion. This is an interesting idea. But, there is one thing I want to call out here. For the code snippet you provided here, I found that you were using Now, our latest releases have fully supported the Microsoft FM schema. The latest preview release 4.0.0-preview3 can still recognize the variant feature flag specified in .NET schema but our next preview release will only recognize variant feature flag specified in Microsoft FM schema. Besides, all the example projects in preview branch and example code snippets in our public doc for preview version have been changed to Microsoft FM schema. You can have a look at them. Thank you so much! |
@zhiyuanliang-ms - I saw the PR for the schema changes but hadn't looked into it yet. The docs I found for variants was in the {
"feature_management": {
"feature_flags": [
{
"id": "MyVariantFeatureFlag",
"enabled": true,
"allocation": {
"default_when_enabled": "Small",
"client_filters": [
{
"name": "CustomFilter",
"parameters": {
"SomeParam": "SomeValue"
},
"variant": "Big"
}
]
},
"variants": [
{
"name": "Big"
},
{
"name": "Small"
}
]
}
]
}
} |
@CuddleBunny The new variant feature flag configuration you provided is correct.
You are right. The code didn't change much. |
Variants are going to be a huge boon to this library and I'm excited to leverage them. I often find myself creating custom filters that evaluate based on the application state rather than the traditional user centric targeting scenarios. It would be great if we could allocate variants based on these filters. Perhaps something like:
The text was updated successfully, but these errors were encountered: