Prepare env variables using proper namings, export these environment variables.
ff_back_dev_123_some_fixed_issue_231221_short=true
ff_front_dev_456_my_super_feature_010122_long=true
or run label-studio this way:
ff_back_dev_123_some_fixed_issue_231221_short=true label-studio
Prepare feature_flags.yml file with flags:
flagValues:
ff_back_dev_123_some_fixed_issue_231221_short: true
ff_front_dev_456_my_super_feature_010122_long: true
Naming convention is presented here
Read more about extended format
Set variables:
FEATURE_FLAGS_FROM_FILE=true
FEATURE_FLAGS_FILE=feature_flags.yml
FEATURE_FLAGS_OFFLINE=false (by default)fflag_<back|front|all>_<issue_id>_short_description_<date>_<short|long>
(check best practices from here)
from core.feature_flags import flag_set
if flag_set('ff_back_dev_123_new_feature_231221_long', request.user):
run_new_code()
else:
run_old_code()
Feature flags JSON object is available on frontend via
window.APP_SETTINGS.feature_flags
To make use flags with LD client, populate it with bootstrap values