Skip to content

Commit 9f6563e

Browse files
committed
add reasons, table
Signed-off-by: Todd Baert <[email protected]>
1 parent ddd5539 commit 9f6563e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

specification.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
{
224224
"id": "Requirement 2.6",
225225
"machine_id": "requirement_2_6",
226-
"content": "The `provider` SHOULD populate the `flag resolution` structure's `reason` field with a string indicating the semantic reason for the returned flag value.",
226+
"content": "The `provider` SHOULD populate the `flag resolution` structure's `reason` field with `\"DEFAULT\",` `\"TARGETING_MATCH\"`, `\"SPLIT\"`, `\"DISABLED\"`, `\"UNKNOWN\"`, `\"ERROR\"` or some other string indicating the semantic reason for the returned flag value.",
227227
"RFC 2119 keyword": "SHOULD",
228228
"children": []
229229
},

specification/sections/02-providers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ The value of the variant field might only be meaningful in the context of the fl
7575

7676
##### Requirement 2.6
7777

78-
> The `provider` **SHOULD** populate the `flag resolution` structure's `reason` field with a string indicating the semantic reason for the returned flag value.
78+
> The `provider` **SHOULD** populate the `flag resolution` structure's `reason` field with `"DEFAULT",` `"TARGETING_MATCH"`, `"SPLIT"`, `"DISABLED"`, `"UNKNOWN"`, `"ERROR"` or some other string indicating the semantic reason for the returned flag value.
7979
80-
Possible values vary by provider, but might include such values as `"TARGETING_MATCH"`, `"SPLIT"`, `"DISABLED"`, `"DEFAULT"`, `"UNKNOWN"` or `"ERROR"`.
80+
As indicated in the definition of the [`flag resolution`](../types.md#resolution-details) structure, the `reason` should be a string. This allows providers to reflect accurately why a flag was resolved to a particular value.
8181

8282
##### Requirement 2.7
8383

specification/types.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ A structure which contains a subset of the fields defined in the `evaluation det
4949
- reason (string, optional)
5050
- variant (string, optional)
5151

52+
A set of pre-defined reasons is enumerated below:
53+
54+
| Reason | Explanation |
55+
| --------------- | ----------------------------------------------------------------------------------------------------- |
56+
| DEFAULT | The resolved value was configured statically, or otherwise fell back to a pre-configured value. |
57+
| TARGETING_MATCH | The resolved value was the result of a dynamic evaluation, such as a rule or specific user-targeting. |
58+
| SPLIT | The resolved value was the result of pseudorandom assignment. |
59+
| DISABLED | The resolved value was the result of the flag being disabled in the management system. |
60+
| UNKNOWN | The reason for the resolved value could not be determined. |
61+
| ERROR | The resolved value was the result of an error. |
62+
5263
> NOTE: The `resolution details` structure is not exposed to the Application Author. It defines the data which Provider Authors must return when resolving the value of flags.
5364
5465
### Evaluation Options

0 commit comments

Comments
 (0)