go-feature-flag v1, new flag format #229
Replies: 6 comments
-
Do you have a document with more examples? How will the rule given be evaluated? I see that Just thinking out loud, but maybe you have considered all of that already: Although the new format seems to be much more flexible I also find it quite difficult to understand. Plus, people with less experience about feature flags would have a hard time to do changes. Given your new YAML format I wonder if one could 'type' the kind of format rule like so: <flag-name>
<rule-kind>:
<rule-settings>
Some simple use-cases (especially projects just starting with feature-flags) a 'simple' set of rule kinds would be nice to have. Plus you can add rule kinds more easily in the future without breaking existing setups. Having a dev-flag:
always-true: vs. dev-flag:
always-false: Alternatively to dev-flag:
bool:
value: true Or a simple value-flag for simple cases like so: dev-flag:
value: true # can be an integer as well For very simple A/B testing: new-feature:
a/b-test: # boolean flag that returns true for 60% of our users
percentage: 60 Using this configuration style one could migrate legacy rules into this format (which is not too difficult to automate): test-flag:
legacy: # well... maybe you have a more descriptive name :)
rule: key eq "random-key"
percentage: 100
true: true
false: false
default: false |
Beta Was this translation helpful? Give feedback.
-
@urso I love the ideas, definitely, the new format will be harder to maintain. Concerning the last element, I want to have backward compatibility and avoid breaking the actual configuration files. I am off for a few days, but I will try to answer your questions about the format in detail when I am back. |
Beta Was this translation helpful? Give feedback.
-
Fair. Another alternative solution I can think of is to version the flags configuration file. For example:
for legacy configuration. And for the 1.0 format:
If Having About "multi-file-support": I do not expect
Fortunately this interface is very compatible with almost all SDKs/libs. The interface already allows me to combine multiple instances of |
Beta Was this translation helpful? Give feedback.
-
@urso I finally have the time to answer you properly.
Yes you can have multiple rule in
Yes, this is also what I am worried about, it adds more control over your flag but it is also more complex. |
Beta Was this translation helpful? Give feedback.
-
I have reviewed the flag format a bit the format and it should be an array for the targeting to be sure we handle them in order. test-flag:
variations:
VariationDefault: false # the name could be anything
VariationBar: false
VariationFoo: true
targeting:
- name: rule-number-1
query: key eq "random-key"
percentage:
VariationBar: 0
VariationFoo: 100
- name: rule-number-2
query: key eq "random-key"
percentage:
VariationBar: 0
VariationFoo: 100
default:
variation: VariationDefault |
Beta Was this translation helpful? Give feedback.
-
The roadmap for the version 1.0.0 is available in this issue #291 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
go-feature-flag
is super easy when it comes to writing your flags in a config file, but it has a limitation, you cannot have multiple variations in your flags.That's the reason why I wanted to introduce a new way to write your flags, it will be more verbose to write them, BUT it will give you a fine-grained possibility to set up your configuration.
Let's say we have something like this before:
We could translate that like this:
It allows way more possibility.
To have an easy migration path, we can also keep supporting the old format for sometimes.
Do you think it could improve the way
go-feature-flag
is working?Beta Was this translation helpful? Give feedback.
All reactions