Skip to content

Improve `#stub_feature_flags` semantic

Kamil Trzciński (Back 2025-01-01) requested to merge improve-stub-semantic into master

Description of the proposal

This changes the #stub_feature_flags to be:

  1. stub_feature_flags(ci_live_trace: false): Disable ci_live_trace feature flag globally
  2. stub_feature_flags(ci_live_trace: project) and stub_feature_flags(ci_live_trace: [project1, project2]): Enable ci_live_trace feature flag only on the specified projects

This MR:

  1. Updates stub_feature_flags semantic
  2. This also changes flipper_adapter to use Memory backend, as some of the specs fallback to using Flipper directly
  3. Updates all relevant places in specs, there's just a few of them

This does represent an actual behaviour of Flipper:

  1. You can enable selectively: enable means create override for a specific gate
  2. You cannot disable selectively: disable means remove override for a specific gate

For example:

[2] pry(main)> Feature.enable(:my_feature)
[3] pry(main)> Feature.disable(:my_feature, Project.last)
[4] pry(main)> Feature.enabled?(:my_feature) => true
[5] pry(main)> Feature.enabled?(:my_feature, Project.last) => true

and alternatively:

[6] pry(main)> Feature.disable(:my_feature2)
[7] pry(main)> Feature.enable(:my_feature2, Project.last)
[8] pry(main)> Feature.enabled?(:my_feature2) => false
[9] pry(main)> Feature.enabled?(:my_feature2, Project.last) => true

Check-list

  • Mention this proposal in the relevant Slack channels (e.g. #development, #backend, #frontend)
  • Follow the review process as usual

Related to: !31610 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading