Unleash / unleash

Open-source feature management solution built for developers.
https://getunleash.io
Apache License 2.0
10.71k stars 667 forks source link

feat: Support global variables/constants #7537

Open Hansemeister opened 1 week ago

Hansemeister commented 1 week ago

Describe the feature request

I want Unleash to support string variables that can be defined one place, and referenced in multiple activation strategies / constraints / variants. In a string-replacement kind of way.

Background

Purpose is to avoid duplicating configuration, and to easily modify multiple resources safely with less chance of "missing a spot". This is especially useful with larger teams where you want the configurations to be consistent across Projects / strategies.

Solution suggestions

Backend - Variables can be persisted in postgres database. Frontend - How it could look using $(VAR_NAME) syntax :

Variables page image

Constraints page: image

Variants page: image

FredrikOseberg commented 6 days ago

@Hansemeister Thanks for the suggestion! I think we already have something in this area that may make it easier for you to manage configuration for multiple feature toggles. For this purpose we already have segments which allows you to define re-usable sets of constraint that can be updated in one central place. Does that solve this use case for you?

Hansemeister commented 6 days ago

@FredrikOseberg Neat! Unleash Segments solve my use case for the constraints. However for the variants, it could still be useful to have variables to use in the payloads.