bucketeer-io / bucketeer

Feature Flag Management and A/B Testing platform

Home Page:https://bucketeer.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fix: evaluation on prerequisite fails in a certain condition

kentakozuka opened this issue · comments

Version

main

Describe the bug

Evaluation on prerequisite fails in a condition;

  • Flag A has a prerequisite depending on flag B.
  • Flag A is a target feature(updatedFeatures) and Flag B is not.
    evalTargets := e.getPrerequisiteUpwards(updatedFeatures, featuresHavePrerequisite)
    .
classDiagram
    FlagB <|-- FlagA
    class FlagA{
      Prerequisite FlagB
    }
Loading

In this case, the evaluation fails because flag B is not evaluated before flag A.

return nil, nil, ErrPrerequisiteVariationNotFound

The root cause of this failure is that flag B is not added in getPrerequisiteUpwards().

evalTargets := e.getPrerequisiteUpwards(updatedFeatures, featuresHavePrerequisite)

See the test case (#967)

Steps to reproduce the bug

No response

Expected behavior

No response

Relevant log output

No response

Additional information

No response