From e40ec3ce2b0a61aca14261846432a50afb9cb312 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Tue, 29 Sep 2026 10:17:25 +0200 Subject: [PATCH 1/3] fix: add dependency cases for a parent that is off by its strategy Co-Authored-By: Claude Fable 5.1 --- specifications/17-dependent-features.json | 118 ++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/specifications/17-dependent-features.json b/specifications/17-dependent-features.json index b9428cd..fa927c4 100644 --- a/specifications/17-dependent-features.json +++ b/specifications/17-dependent-features.json @@ -653,6 +653,60 @@ }, "variants": [] }] + }, + { + "name": "parent.with.constraint.child.expects.disabled", + "description": "The parent is enabled and has a constraint. The child expects the parent to be disabled.", + "enabled": true, + "dependencies": [{ + "feature": "parent.with.constraint", + "enabled": false + }], + "strategies": [{ + "name": "flexibleRollout", + "parameters": { + "rollout": "100", + "stickiness": "default", + "groupId": "groupId" + }, + "variants": [ + { + "name": "child.variant", + "weight": 1, + "payload": { + "type": "string", + "value": "variantValue" + } + } + ] + }] + }, + { + "name": "parent.with.constraint.child.expects.disabled.variant", + "description": "The parent is enabled and has a constraint. The child expects the parent's variant to be \"disabled\".", + "enabled": true, + "dependencies": [{ + "feature": "parent.with.constraint", + "variants": ["disabled"] + }], + "strategies": [{ + "name": "flexibleRollout", + "parameters": { + "rollout": "100", + "stickiness": "default", + "groupId": "groupId" + }, + "variants": [ + { + "name": "child.variant", + "weight": 1, + "payload": { + "type": "string", + "value": "variantValue" + } + } + ] + }] } ] }, @@ -780,6 +834,30 @@ "context": {}, "toggleName": "parent.disabled.child.expects.disabled.variant", "expectedResult": false + }, + { + "description": "Child is enabled if the parent is expected to be disabled and the parent's constraint does not match.", + "context": { + "environment": "dev" + }, + "toggleName": "parent.with.constraint.child.expects.disabled", + "expectedResult": true + }, + { + "description": "Child is disabled if the parent is expected to be disabled but the parent's constraint matches.", + "context": { + "environment": "prod" + }, + "toggleName": "parent.with.constraint.child.expects.disabled", + "expectedResult": false + }, + { + "description": "Child is disabled if the parent's constraint does not match, even if the child's expected variant is the disabled variant", + "context": { + "environment": "dev" + }, + "toggleName": "parent.with.constraint.child.expects.disabled.variant", + "expectedResult": false } ], "variantTests": [ @@ -1012,6 +1090,46 @@ "enabled": true, "feature_enabled": true } + }, + { + "description": "Child yields its variant when the parent is expected to be disabled and the parent's constraint does not match.", + "context": { + "environment": "dev" + }, + "toggleName": "parent.with.constraint.child.expects.disabled", + "expectedResult": { + "name": "child.variant", + "payload": { + "type": "string", + "value": "variantValue" + }, + "enabled": true, + "feature_enabled": true + } + }, + { + "description": "Child yields a disabled variant when the parent is expected to be disabled but the parent's constraint matches.", + "context": { + "environment": "prod" + }, + "toggleName": "parent.with.constraint.child.expects.disabled", + "expectedResult": { + "name": "disabled", + "enabled": false, + "feature_enabled": false + } + }, + { + "description": "Child yields a disabled variant when the parent's constraint does not match, even if the child's expected variant is the disabled variant.", + "context": { + "environment": "dev" + }, + "toggleName": "parent.with.constraint.child.expects.disabled.variant", + "expectedResult": { + "name": "disabled", + "enabled": false, + "feature_enabled": false + } } ] } From 86b87bca2dfc5ffc00de627f2617e96a5c2ad2de Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Tue, 29 Sep 2026 10:48:34 +0200 Subject: [PATCH 2/3] test: add missing test cases --- specifications/17-dependent-features.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specifications/17-dependent-features.json b/specifications/17-dependent-features.json index fa927c4..4c56c23 100644 --- a/specifications/17-dependent-features.json +++ b/specifications/17-dependent-features.json @@ -852,7 +852,7 @@ "expectedResult": false }, { - "description": "Child is disabled if the parent's constraint does not match, even if the child's expected variant is the disabled variant", + "description": "Child is disabled when it requires the parent's variant to be \"disabled\" and the parent is off because its constraint does not match.", "context": { "environment": "dev" }, @@ -1120,7 +1120,7 @@ } }, { - "description": "Child yields a disabled variant when the parent's constraint does not match, even if the child's expected variant is the disabled variant.", + "description": "Child yields a disabled variant when it requires the parent's variant to be \"disabled\" and the parent is off because its constraint does not match.", "context": { "environment": "dev" }, From fea7aa0d5e8694b503bc211ce76e6c05f35b8531 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Tue, 29 Sep 2026 10:53:22 +0200 Subject: [PATCH 3/3] test: remove a case that repeats an existing rule Co-Authored-By: Claude Fable 5.1 --- specifications/17-dependent-features.json | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/specifications/17-dependent-features.json b/specifications/17-dependent-features.json index 4c56c23..27948c9 100644 --- a/specifications/17-dependent-features.json +++ b/specifications/17-dependent-features.json @@ -843,14 +843,6 @@ "toggleName": "parent.with.constraint.child.expects.disabled", "expectedResult": true }, - { - "description": "Child is disabled if the parent is expected to be disabled but the parent's constraint matches.", - "context": { - "environment": "prod" - }, - "toggleName": "parent.with.constraint.child.expects.disabled", - "expectedResult": false - }, { "description": "Child is disabled when it requires the parent's variant to be \"disabled\" and the parent is off because its constraint does not match.", "context": { @@ -1107,18 +1099,6 @@ "feature_enabled": true } }, - { - "description": "Child yields a disabled variant when the parent is expected to be disabled but the parent's constraint matches.", - "context": { - "environment": "prod" - }, - "toggleName": "parent.with.constraint.child.expects.disabled", - "expectedResult": { - "name": "disabled", - "enabled": false, - "feature_enabled": false - } - }, { "description": "Child yields a disabled variant when it requires the parent's variant to be \"disabled\" and the parent is off because its constraint does not match.", "context": {