1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

docs: variant dependencies (#6758)

This commit is contained in:
Mateusz Kwasniewski 2024-04-03 10:31:58 +02:00 committed by GitHub
parent 2cbb45de85
commit fe6aaf7739
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,17 +5,34 @@ title: Dependent Features
:::info Availability
**Dependent features** were first introduced in Unleash 5.7 for Pro and Enterprise users.
**Variant dependencies** were first introduced in Unleash 5.12 for Pro and Enterprise users.
:::
## Overview
Dependent features allow to define a child feature flag that depends on a parent feature flag.
A feature flag can have only one parent dependency but multiple child flags can share the same parent. For a child flag to be activated, its parent dependency must be enabled.
A feature flag can have only one parent dependency but multiple child flags can share the same parent. For a child flag to be activated, its parent dependency must be satisfied.
## Parent dependency criteria
* **Project Association**: Both parent and child flags should belong to the same project.
* **Single Level Dependency**: The parent flag cant have its own parent, ensuring a straightforward, single-level dependency.
* **Parent Value**: Parent value should match predefined feature status and variant criteria.
### Parent value criteria
In order for the child feature to be evaluated, the corresponding parent value criteria must be satisfied.
Parent value criteria can be set to one of the 3 options:
* parent feature must be **enabled**.
* parent feature must be **disabled**. This is useful when your parent is a [kill-switch](./feature-toggle-types.md#feature-toggle-types) with the inverted enabled/disabled logic.
* parent feature must be **enabled with variants**. This is useful when your parent is part of A/B testing, and you need **variant dependencies**.
For the **variant dependencies**, if the parent feature variant is evaluated to the expected value, the dependency is satisfied.
You can specify variant values from all [strategy variants](./strategy-variants.md) and all [feature environment variants](./feature-toggle-variants.md). The parent dependency variant
is compared to the actual value that the parent dependency is evaluated to in a given environment.
Consult [strategy variants order](./strategy-variants.md#strategy-variants-and-strategies-order) and [variants comparison](./strategy-variants#strategy-variants-vs-feature-toggle-variants) sections for more details on the variant evaluation order.
## Managing dependencies