You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- If we want the same flag to be part of multiple flag sets, we need to duplicate the flag in multiple files.
174
174
175
175
### Solution 3
176
-
:::note
177
-
Feel free to propose other solutions here.
178
-
:::
176
+
In this solution we want to offer multiple way to specify the flag set in the configuration.
177
+
This solution will be more complex to implement, but it will give more flexibility to the users.
178
+
179
+
In this solution the flag set could be defined:
180
+
1. In the retriever configuration _(like in solution 2)_.
181
+
2. And in the flag configuration file with a specific format.
182
+
183
+
#### example: In the retriever configuration
184
+
185
+
The relay proxy configuration will look like this:
186
+
```yaml
187
+
# ...
188
+
retrievers:
189
+
- kind: file
190
+
path: config-file.goff.yaml
191
+
flagSet: flagset-teamA
192
+
# ...
193
+
```
194
+
195
+
And the flag configuration file (`config-file.goff.yaml`) will look like this:
196
+
```yaml
197
+
# all the flags in this file will be part of the flag set flagset-teamA
198
+
# ...
199
+
test-flag:
200
+
variations:
201
+
enabled: true
202
+
disabled: false
203
+
defaultRule:
204
+
variation: enabled
205
+
# ...
206
+
```
207
+
208
+
#### example: In the flag configuration file with a specific format
209
+
210
+
In that case we don't need to specify the flag set in the retriever configuration.
211
+
The relay proxy configuration will look like this:
212
+
```yaml
213
+
# ...
214
+
retrievers:
215
+
- kind: file
216
+
path: config-file.goff.yaml
217
+
# ...
218
+
```
219
+
220
+
And the flag configuration file (`config-file.goff.yaml`) will look like this:
221
+
```yaml
222
+
# flagSets is a new key in the configuration file, that allow to create a super set with multiple flag sets.
223
+
flagSets:
224
+
- name: flagset-teamA
225
+
flags:
226
+
test-flag2:
227
+
variations:
228
+
Default: false
229
+
False: false
230
+
True: true
231
+
targeting:
232
+
- name: rule1
233
+
query: key eq "not-a-key"
234
+
percentage:
235
+
False: 0
236
+
True: 100
237
+
defaultRule:
238
+
name: defaultRule
239
+
variation: Default
240
+
- name: flagset-teamB
241
+
flags:
242
+
test-flag2:
243
+
# ...
244
+
```
245
+
246
+
**PRO**
247
+
- It gives flexibility in the way of creating the flag sets _(in the retriever or in the flag configuration file)_.
248
+
- We can create multiple flag sets from a single retriver, by generating multiple flag sets in the flag configuration file.
249
+
- We can still have multiple files for 1 flag set _(by specifying the same `flagSet` name in each file)_.
250
+
- If we don't want to change the format of our configuration file, we can still set the flag sey in the retriever configuration.
251
+
252
+
**CON**
253
+
- If we configure a flag set name both in the retriever and in the flag configuration file, we need to decide which one to use _(most likely the one in the file)._
254
+
- It is a bit more complex to implement than the other solutions.
0 commit comments