-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Test if rule format is valid (#2795)
* feat: Test if rule format is valid Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org> * chore: simplify query Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org> * fix: invalid rule in a valid flag file Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org> --------- Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
- Loading branch information
1 parent
8ae0c6d
commit 473c8f3
Showing
5 changed files
with
176 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,136 +1,136 @@ | ||
array-flag: | ||
variations: | ||
Default: | ||
- batmanDefault | ||
- supermanDefault | ||
- superherosDefault | ||
"False": | ||
- batmanFalse | ||
- supermanFalse | ||
- superherosFalse | ||
"True": | ||
- batmanTrue | ||
- supermanTrue | ||
- superherosTrue | ||
targeting: | ||
- name: rule1 | ||
query: anonymous eq true | ||
percentage: | ||
"False": 90 | ||
"True": 10 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
variations: | ||
Default: | ||
- batmanDefault | ||
- supermanDefault | ||
- superherosDefault | ||
"False": | ||
- batmanFalse | ||
- supermanFalse | ||
- superherosFalse | ||
"True": | ||
- batmanTrue | ||
- supermanTrue | ||
- superherosTrue | ||
targeting: | ||
- name: rule1 | ||
query: anonymous eq true | ||
percentage: | ||
"False": 90 | ||
"True": 10 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
disable-flag: | ||
variations: | ||
Default: default | ||
"False": "false" | ||
"True": "true" | ||
targeting: | ||
- name: rule1 | ||
query: admin eq true | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
disable: true | ||
variations: | ||
Default: default | ||
"False": "false" | ||
"True": "true" | ||
targeting: | ||
- name: rule1 | ||
query: admin eq true | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
disable: true | ||
flag-only-for-admin: | ||
variations: | ||
Default: false | ||
"False": false | ||
"True": true | ||
targeting: | ||
- name: rule1 | ||
query: admin eq true | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
variations: | ||
Default: false | ||
"False": false | ||
"True": true | ||
targeting: | ||
- name: rule1 | ||
query: admin eq true | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
new-admin-access: | ||
variations: | ||
Default: false | ||
"False": false | ||
"True": true | ||
defaultRule: | ||
name: defaultRule | ||
percentage: | ||
"False": 70 | ||
"True": 30 | ||
variations: | ||
Default: false | ||
"False": false | ||
"True": true | ||
defaultRule: | ||
name: defaultRule | ||
percentage: | ||
"False": 70 | ||
"True": 30 | ||
number-flag: | ||
variations: | ||
Default: 1 | ||
"False": 3 | ||
"True": 2 | ||
targeting: | ||
- name: rule1 | ||
query: anonymous eq true | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
variations: | ||
Default: 1 | ||
"False": 3 | ||
"True": 2 | ||
targeting: | ||
- name: rule1 | ||
query: anonymous eq true | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
targeting-key-rule: | ||
variations: | ||
false_var: false | ||
true_var: true | ||
targeting: | ||
- query: targetingKey eq "specific-targeting-key" | ||
variation: true_var | ||
defaultRule: | ||
variation: false_var | ||
variations: | ||
false_var: false | ||
true_var: true | ||
targeting: | ||
- query: targetingKey eq "specific-targeting-key" | ||
variation: true_var | ||
defaultRule: | ||
variation: false_var | ||
test-flag-rule-apply: | ||
variations: | ||
Default: | ||
test: test | ||
"False": | ||
test3: test | ||
"True": | ||
test2: test | ||
targeting: | ||
- name: rule1 | ||
query: key eq "random-key" | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
variations: | ||
Default: | ||
test: test | ||
"False": | ||
test3: test | ||
"True": | ||
test2: test | ||
targeting: | ||
- name: rule1 | ||
query: key eq "random-key" | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
test-flag-rule-apply-false: | ||
variations: | ||
Default: | ||
test: test | ||
"False": | ||
test3: test | ||
"True": | ||
test2: test | ||
targeting: | ||
- name: rule1 | ||
query: anonymous eq true | ||
percentage: | ||
"False": 90 | ||
"True": 10 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
variations: | ||
Default: | ||
test: test | ||
"False": | ||
test3: test | ||
"True": | ||
test2: test | ||
targeting: | ||
- name: rule1 | ||
query: anonymous eq true | ||
percentage: | ||
"False": 90 | ||
"True": 10 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
test-flag-rule-not-apply: | ||
variations: | ||
Default: | ||
test: test | ||
"False": | ||
test3: test | ||
"True": | ||
test2: test | ||
targeting: | ||
- name: rule1 | ||
query: key eq \"key\" | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default | ||
variations: | ||
Default: | ||
test: test | ||
"False": | ||
test3: test | ||
"True": | ||
test2: test | ||
targeting: | ||
- name: rule1 | ||
query: key eq "key" | ||
percentage: | ||
"False": 0 | ||
"True": 100 | ||
defaultRule: | ||
name: defaultRule | ||
variation: Default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters