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

docs: dependent features (#5058)

This commit is contained in:
Mateusz Kwasniewski 2023-10-18 08:57:04 +02:00 committed by GitHub
parent d6607373fa
commit 4dd01c1765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 5 deletions

View File

@ -0,0 +1,60 @@
---
title: Dependent features
---
:::info Availability
**Dependent features** were first introduced in Unleash 5.7 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.
## 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.
## Managing dependencies
### Adding
Introduce dependencies either through the UI or API, also applicable when copying a child feature with an existing parent dependency.
![A button for adding parent dependency.](/img/add-parent-dependency.png 'Adding a new parent feature dependency')
### Removing
Eliminate them through the UI or API. Dependencies are also removed when archiving a child feature. A parent feature cant be removed if it would leave a child feature orphaned. To remove both, batch archive them. If Unleash confirms no other child features are using the parent, archiving proceeds.
![A button for deleting parent dependency.](/img/delete-parent-dependency.png 'Depeting a parent feature dependency')
## Permissions
The **Update feature dependency** project permission, auto-assigned to admin and project members, allows managing dependencies.
## Metrics calculation
Metrics are influenced solely by the evaluation of child features.
## Client SDK Support {#client-sdk-support}
To make use of dependent feature, you need to use a compatible client. Client SDK with variant support:
- [unleash-client-node](https://github.com/Unleash/unleash-client-node) (from v4.2.0)
- [unleash-client-java](https://github.com/Unleash/unleash-client-java) (from v8.4.0)
- [unleash-client-go](https://github.com/Unleash/unleash-client-go) (from v3.9.0)
- [unleash-client-python](https://github.com/Unleash/unleash-client-python) (from v5.9.0)
- [unleash-client-ruby](https://github.com/Unleash/unleash-client-ruby) (from v4.6.0)
- [unleash-client-dotnet](https://github.com/Unleash/unleash-client-dotnet) (from v3.4.0)
- [unleash-client-php](https://github.com/Unleash/unleash-client-php) (from v1.14.0)
- Client SDKs talking to [unleash-proxy](https://github.com/Unleash/unleash-proxy) (from v0.18.0)
- Client SDKs talking to [unleash-edge](https://github.com/Unleash/unleash-edge) (from v13.1.0)
- Client SDKs talking to Frontend API in [unleash-server](https://github.com/Unleash/unleash) (from v5.7.0)
- Unleash Playground in [unleash-server](https://github.com/Unleash/unleash) (from v5.7.0)
If you would like to give feedback on this feature, experience issues or have questions, please feel free to open an issue on [GitHub](https://github.com/Unleash/unleash/).

View File

@ -9,14 +9,14 @@ The environment import and export first appeared in Unleash 4.22.0.
:::
<VideoContent videoUrls={["https://www.youtube.com/embed/Bs73l2fZxJ4"]}/>
Environment export and import lets you copy feature configurations from one environment to another and even copy features from one Unleash instance to another.
When exporting, you select a set of features and **one** environment to export the configuration from. The environment must be the same for all features.
Then, when you import, you must select **one** environment and **one** project to import into. All features are imported into that project in that environment. If Unleash is unable to import the configuration safely, it will tell you why the import failed and what you need to do fix it (read more about [import rejection](#import-rejection).
Then, when you import, you must select **one** environment and **one** project to import into. All features are imported into that project in that environment. If Unleash is unable to import the configuration safely, it will tell you why the import failed and what you need to do fix it (read more about [import requirements](#import-requirements).
## Import & Export items
@ -26,6 +26,7 @@ On the project-level these items are exported:
* [the feature itself](../feature-toggles.mdx)
* [feature tags](../tags.md)
* [feature dependencies](../dependent-features.md)
On the environment-level, these items are exported for the chosen environment:
@ -37,7 +38,7 @@ Additionally, these global configuration items are exported:
* [custom context fields](../unleash-context.md#custom-context-fields)
* [feature tag types](../tags.md#tag-types)
Importantly, while references to [segments](../segments.mdx) are exported, the segments themselves are **not** exported. Consult the [import rejection](#import-rejection) section for more information.
Importantly, while references to [segments](../segments.mdx) are exported, the segments themselves are **not** exported. Consult the [import requirements](#import-requirements) section for more information.
## Export
@ -77,6 +78,10 @@ Custom context fields that don't already exist in the target instance will be cr
If your import has segments, then a segment with the same name must already exist in the Unleash instance you are trying to import into. Only the name must be the same: the constraints in the segment can be different.
#### Dependencies
If your import has a parent feature dependency, then the parent feature must already exist in the target Unleash instance or be part of the import data. The existing feature is identified by name.
#### Custom strategies
If your import contains custom strategies, then custom strategies with the same names must already exist in the target Unleash instance. The custom strategy definitions (including strategy parameters) that exist in the target instance do not otherwise need to match the custom strategy definitions in the instance the import came from.
@ -115,7 +120,7 @@ Additionally, depending on the actions your import job would trigger, you may al
* **Create activation strategies**: when the import would add activation strategies to a feature and change requests are disabled
* **Delete activation strategies**: when import would remove existing activation strategies from a feature and change requests are disabled
* **Update variants**: when the import would update variants and change requests are disabled
* **Update feature dependency**: when the import would add feature dependencies and change requests are disabled
### Import and change requests

View File

@ -408,6 +408,7 @@ module.exports = {
'reference/technical-debt',
'reference/unleash-context',
'reference/change-requests',
'reference/dependent-features',
],
},
'generated/unleash-edge',

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB