Skip to content

Commit 82779d3

Browse files
Merge pull request #89 from harness/FFM-3625
FFM-3625 - Flags with pre-reqs always evaluating to off state
2 parents dc7a058 + 17dbde7 commit 82779d3

File tree

2 files changed

+619
-4
lines changed

2 files changed

+619
-4
lines changed

evaluation/feature.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,21 @@ func prereqsSatisfied(fc FeatureConfig, target *Target, flags map[string]Feature
297297
}
298298

299299
prereqsSatisfied := true
300-
for _, pre := range fc.Prerequisites {
301300

301+
for _, pre := range fc.Prerequisites {
302302
prereqFlag, ok := flags[pre.Feature]
303303
if !ok {
304304
continue
305305
}
306306

307-
variation := fc.Variations.FindByIdentifier(fc.GetVariationName(target))
308307
variationToMatch := prereqFlag.Variations.FindByIdentifier(prereqFlag.GetVariationName(target))
309308

310-
if variation.Value != variationToMatch.Value {
311-
prereqsSatisfied = false
309+
if pre.Feature == prereqFlag.Feature {
310+
for _, variation := range pre.Variations {
311+
if variation != variationToMatch.Value {
312+
return false
313+
}
314+
}
312315
}
313316
}
314317

0 commit comments

Comments
 (0)