From 73783c10aa4d1d40b47eb600cd8afc563aa1a8a2 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Fri, 27 Oct 2023 10:22:03 +0300 Subject: [PATCH 1/4] debug: client spec fail --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa20796..bd74e1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: name: Checkout client specifications with: repository: Unleash/client-specification - ref: refs/tags/v4.3.1 + ref: refs/tags/v4.3.2 path: testdata/client-specification - uses: actions/setup-go@v2 name: Setup go From d3ce618bd45fbce4f28216851b8687b25c66114e Mon Sep 17 00:00:00 2001 From: sjaanus Date: Fri, 27 Oct 2023 10:27:49 +0300 Subject: [PATCH 2/4] 4.3.3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd74e1e..7058ff4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: name: Checkout client specifications with: repository: Unleash/client-specification - ref: refs/tags/v4.3.2 + ref: refs/tags/v4.3.3 path: testdata/client-specification - uses: actions/setup-go@v2 name: Setup go From e3dd3361ffbebd53d590530193e52f9bd7b6764d Mon Sep 17 00:00:00 2001 From: sjaanus Date: Fri, 27 Oct 2023 12:25:43 +0300 Subject: [PATCH 3/4] fix: dependent feature toggle evaluation --- client.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index 7c6caf7..a2190eb 100644 --- a/client.go +++ b/client.go @@ -356,16 +356,16 @@ func (uc *Client) isParentDependencySatisfied(feature *api.Feature, context cont return false } + enabledResult := uc.isEnabled(parent.Feature, WithContext(context)) // According to the schema, if the enabled property is absent we assume it's true. if parent.Enabled == nil { - if parent.Variants != nil && len(*parent.Variants) > 0 { - variantName := uc.getVariantWithoutMetrics(parent.Feature, WithVariantContext(context)).Name - return contains(*parent.Variants, variantName) + if parent.Variants != nil && len(*parent.Variants) > 0 && enabledResult.Variant != nil { + return enabledResult.Enabled && contains(*parent.Variants, enabledResult.Variant.Name) } - return uc.isEnabled(parent.Feature, WithContext(context)).Enabled + return enabledResult.Enabled } - return !uc.isEnabled(parent.Feature, WithContext(context)).Enabled + return !enabledResult.Enabled } allDependenciesSatisfied := every(*feature.Dependencies, func(parent interface{}) bool { From 7cfe38784f924cb4c873774ba88d8be7000cd943 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Fri, 27 Oct 2023 12:27:21 +0300 Subject: [PATCH 4/4] 4.5.2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7058ff4..95aab20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: name: Checkout client specifications with: repository: Unleash/client-specification - ref: refs/tags/v4.3.3 + ref: refs/tags/v4.5.2 path: testdata/client-specification - uses: actions/setup-go@v2 name: Setup go