Repository navigation
[FFL-1695] test: add variant-key dependent flag conformance fixtures #45
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| [ | ||
| { | ||
| "description": "A root flag matches a direct prerequisite by variant key.", | ||
| "attributes": {}, | ||
| "defaultValue": "caller-default", | ||
| "flag": "dependent-direct-root", | ||
| "result": { | ||
| "reason": "TARGETING_MATCH", | ||
| "value": "direct-match" | ||
| }, | ||
| "targetingKey": "dependent-direct", | ||
| "variationType": "STRING" | ||
| }, | ||
| { | ||
| "description": "ONE_OF does not match when the prerequisite variant key is absent from the allowed list.", | ||
| "attributes": {}, | ||
| "defaultValue": "caller-default", | ||
| "flag": "dependent-one-of-miss-root", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 Comment from Claude working with Aaron Silverman: [P1] At current The design's example uses a rule that requires both a user attribute (country) and a prerequisite flag's value. For a user who matches the attribute but whose prerequisite evaluates to the other variant, the root serves its fallback, and the example lists both the root and the prerequisite for exposure handling (subject to the usual logging rules and deduplication): the prerequisite decided the root's result. The design's numbered rule about rejected rules can be read more broadly, so the design is ambiguous here; the example and its stated reasoning are the clearer guide. #58 added telemetry expectations to this case and to Suggested change:
All evaluators and DataDog/system-tests#8051 follow the current expectation, so this also needs evaluator updates (libdatadog, openfeature-js-client, Go, Java, .NET) and the matching |
||
| "result": { | ||
| "reason": "STATIC", | ||
| "value": "one-of-fallback" | ||
| }, | ||
| "targetingKey": "dependent-one-of-miss", | ||
| "variationType": "STRING" | ||
| }, | ||
| { | ||
| "description": "NOT_ONE_OF does not match when the prerequisite variant key is present in the excluded list.", | ||
| "attributes": {}, | ||
| "defaultValue": "caller-default", | ||
| "flag": "dependent-not-one-of-hit-root", | ||
| "result": { | ||
| "reason": "STATIC", | ||
| "value": "not-one-of-fallback" | ||
| }, | ||
| "targetingKey": "dependent-not-one-of-hit", | ||
| "variationType": "STRING" | ||
| }, | ||
| { | ||
| "description": "A depth-two tree evaluates its leaf and intermediate prerequisite before matching the root.", | ||
| "attributes": {}, | ||
| "defaultValue": "caller-default", | ||
| "flag": "dependent-transitive-root", | ||
| "result": { | ||
| "reason": "TARGETING_MATCH", | ||
| "value": "transitive-match" | ||
| }, | ||
| "targetingKey": "dependent-transitive", | ||
| "variationType": "STRING" | ||
| }, | ||
| { | ||
| "description": "A false attribute condition short-circuits before an otherwise fatal missing prerequisite and selects the root fallback.", | ||
| "attributes": { | ||
| "gate": "closed" | ||
| }, | ||
| "defaultValue": "caller-default", | ||
| "flag": "dependent-short-circuit-root", | ||
| "result": { | ||
| "reason": "STATIC", | ||
| "value": "short-circuit-fallback" | ||
| }, | ||
| "targetingKey": "dependent-short-circuit", | ||
| "variationType": "STRING" | ||
| }, | ||
| { | ||
| "description": "Two membership conditions against the same prerequisite evaluate successfully.", | ||
| "attributes": {}, | ||
| "defaultValue": "caller-default", | ||
| "flag": "dependent-memoized-root", | ||
| "result": { | ||
| "reason": "TARGETING_MATCH", | ||
| "value": "memoized-match" | ||
| }, | ||
| "targetingKey": "dependent-memoized", | ||
| "variationType": "STRING" | ||
| }, | ||
| { | ||
| "description": "A successful prerequisite followed by a missing prerequisite aborts the graph and returns the caller default.", | ||
| "attributes": {}, | ||
| "defaultValue": "atomic-default", | ||
| "flag": "dependent-atomic-error-root", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 Comment from Claude working with Aaron Silverman: [P2] Please pin the root error code in this case and in the depth and cycle cases. When a prerequisite fails, the root should report the general evaluation error, and the prerequisite's own evaluation event should keep the specific code. Today the implementations in this stack disagree, and the shared evaluation suite does not decide:
We propose Suggested change on |
||
| "result": { | ||
| "reason": "ERROR", | ||
| "value": "atomic-default" | ||
| }, | ||
| "targetingKey": "dependent-atomic-error", | ||
| "variationType": "STRING" | ||
| }, | ||
| { | ||
| "description": "With maxDependencyDepth 2, a third dependency edge aborts the graph and returns the caller default.", | ||
| "attributes": {}, | ||
| "defaultValue": "depth-default", | ||
| "flag": "dependent-depth-three-root", | ||
| "result": { | ||
| "reason": "ERROR", | ||
| "value": "depth-default" | ||
| }, | ||
| "targetingKey": "dependent-over-depth", | ||
| "variationType": "STRING" | ||
| }, | ||
| { | ||
| "description": "A dependency cycle aborts the graph and returns the caller default.", | ||
| "attributes": {}, | ||
| "defaultValue": "cycle-default", | ||
| "flag": "dependent-cycle-a", | ||
| "result": { | ||
| "reason": "ERROR", | ||
| "value": "cycle-default" | ||
| }, | ||
| "targetingKey": "dependent-cycle", | ||
| "variationType": "STRING" | ||
| } | ||
| ] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Comment from Claude working with Aaron Silverman:
[P2] Follow-up for this suite, as it stands on
main(b57eac6): some cases have no telemetry assertions, and some behaviors have no case.expectations, so the harness performs no telemetry assertions for them:dependent-direct,dependent-transitive,dependent-memoized,dependent-atomic-error,dependent-over-depthanddependent-cycle. For example, an SDK that sends the leaf exposure before the missing prerequisite abortsdependent-atomic-errorstill passes.doLog: false, or a root withdoLog: falsewhose prerequisite logs. Exposure logging applies per flag.STRINGprerequisites (BOOLEAN,JSON). These check that the comparison uses the variant key, not the value.dependent-memoizedexercises a successfulNOT_ONE_OFcomparison, and it has no telemetry expectations.evaluatorParams) or an invalidmaxDependencyDepth. These need their own suite directories, becauseevaluatorParamsapplies to the whole configuration.Suggested change: add
expectationsto the six cases, and add cases for the missing behaviors in a follow-up PR. The cycle and depth expectations need the evaluators to agree first on which intermediate prerequisites get an evaluation event.