-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
Add support for Aggregate strategies
#102
Comments
The filter-pattern approachA simple way to solve this is extend the current API with a strategies field. The current The suggested solution allows us to keep strategies simple and at the same time add multiple strategies to any toggle without having to implement all possible combinations upfront in all clients. Current format: {
"features": [
{
"name": "featureX",
"description": "",
"enabled": true,
"strategy": "default",
"parameters": {}
},
{
"name": "featureY",
"description": "",
"enabled": true,
"strategy": "ActiveForUserWithEmail",
"parameters": {
"emails": "[email protected]"
}
}
]
} _New API_ {
"version": 1,
"features": [
{
"name": "featureX",
"description": "",
"enabled": true,
"strategy": "default", //kept for backward compability
"parameters": {}, //kept for backward compability
"strategies": [
{
"name": "some_strategy",
"parameters": {}
}
]
},
{
"name": "featureY",
"description": "",
"enabled": true,
"strategy": "default",
"parameters": {},
"strategies": [
{
"name": "some_strategy",
"parameters": {
"emails": "[email protected]"
}
}
]
}
]
} |
+1 Could "strategy" be dropped from the new API? |
yes. But that should be a two-step iteration:
|
we have decided to move forward with multiple strategies. Based on real-world usage of Unleash we feel the need ability to add multiple activation strategies for a feature toggle. To make it simple to understand and easy to use (and based on what people actually have asked for) all strategies should be OR from the client perspective, meaning that if a feature toggle is considered active with one strategy it should be considered enabled. TODO:
|
This commit changes the features-tables: - drop columns 'strategy' and 'parameters' - add column 'strategies' of type json. - migrates existing strategy-mappings in to the new format. The idea is that the 'strategies' column should contain a json-array of strategy-configuration for the toggle: ``` [{ "name" : "strategy1", "parameters": { "name": "vale" } }] ``` To make sure to not break exiting clients the api is extended with a mapping layer (adding old fields to the json-respons, and mapping to the new format on create/update a feature toggle. this commit is first step in solving #102
This commit changes the features-tables: - drop columns 'strategy' and 'parameters' - add column 'strategies' of type json. - migrates existing strategy-mappings in to the new format. The idea is that the 'strategies' column should contain a json-array of strategy-configuration for the toggle: ``` [{ "name" : "strategy1", "parameters": { "name": "vale" } }] ``` To make sure to not break exiting clients the api is extended with a mapping layer (adding old fields to the json-respons, and mapping to the new format on create/update a feature toggle. this commit is first step in solving #102
This commit changes the features-tables: - drop columns 'strategy' and 'parameters' - add column 'strategies' of type json. - migrates existing strategy-mappings in to the new format. The idea is that the 'strategies' column should contain a json-array of strategy-configuration for the toggle: ``` [{ "name" : "strategy1", "parameters": { "name": "vale" } }] ``` To make sure to not break exiting clients the api is extended with a mapping layer (adding old fields to the json-respons, and mapping to the new format on create/update a feature toggle. this commit is first step in solving #102
This commit changes the features-tables: - drop columns 'strategy' and 'parameters' - add column 'strategies' of type json. - migrates existing strategy-mappings in to the new format. The idea is that the 'strategies' column should contain a json-array of strategy-configuration for the toggle: ``` [{ "name" : "strategy1", "parameters": { "name": "vale" } }] ``` To make sure to not break exiting clients the api is extended with a mapping layer (adding old fields to the json-respons, and mapping to the new format on create/update a feature toggle. this commit is first step in solving #102
This commit changes the features-tables: - drop columns 'strategy' and 'parameters' - add column 'strategies' of type json. - migrates existing strategy-mappings in to the new format. The idea is that the 'strategies' column should contain a json-array of strategy-configuration for the toggle: ``` [{ "name" : "strategy1", "parameters": { "name": "vale" } }] ``` To make sure to not break exiting clients the api is extended with a mapping layer (adding old fields to the json-respons, and mapping to the new format on create/update a feature toggle. this commit is first step in solving #102
This commit changes the features-tables: - drop columns 'strategy' and 'parameters' - add column 'strategies' of type json. - migrates existing strategy-mappings in to the new format. The idea is that the 'strategies' column should contain a json-array of strategy-configuration for the toggle: ``` [{ "name" : "strategy1", "parameters": { "name": "vale" } }] ``` To make sure to not break exiting clients the api is extended with a mapping layer (adding old fields to the json-respons, and mapping to the new format on create/update a feature toggle. this commit is first step in solving #102
After using unleash for a while we see that we now have a lot of "aggregate strategies" implemented, such as "usersWithIdAndBetaUsers" etc.
Instead of having all different combinations of strategies implemented in all clients we could provide a way to define aggregated strategies. This way we only need the simple strategies implemented in each client.
The text was updated successfully, but these errors were encountered: