diff --git a/ee/config/feature_flags/experiment/ci_notification_dot_experiment_percentage.yml b/ee/config/feature_flags/experiment/ci_notification_dot_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..3d6f70d2ce578fb77947253913ce5c9d583d1379 --- /dev/null +++ b/ee/config/feature_flags/experiment/ci_notification_dot_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: ci_notification_dot_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27626 +rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/101 +milestone: '12.10' +type: experiment +group: group::expansion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/contact_sales_btn_in_app_experiment_percentage.yml b/ee/config/feature_flags/experiment/contact_sales_btn_in_app_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..80401523f53e96f8e88e17f1f8525ca3cc7c656a --- /dev/null +++ b/ee/config/feature_flags/experiment/contact_sales_btn_in_app_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: contact_sales_btn_in_app_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38508 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/238207 +milestone: '13.3' +type: experiment +group: group::conversion +default_enabled: true diff --git a/ee/config/feature_flags/experiment/customize_homepage_experiment_percentage.yml b/ee/config/feature_flags/experiment/customize_homepage_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..eff0d2785eb448eeba5c2d6270dcbdece5ca19bb --- /dev/null +++ b/ee/config/feature_flags/experiment/customize_homepage_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: customize_homepage_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39348 +rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/187 +milestone: '13.4' +type: experiment +group: group::expansion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/default_to_issues_board_experiment_percentage.yml b/ee/config/feature_flags/experiment/default_to_issues_board_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..d4a695502f945022eae410ee7f699970aca86dc2 --- /dev/null +++ b/ee/config/feature_flags/experiment/default_to_issues_board_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: default_to_issues_board_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/43939 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/268298 +milestone: '13.5' +type: experiment +group: group::conversion +default_enabled: true diff --git a/ee/config/feature_flags/experiment/group_only_trials_experiment_percentage.yml b/ee/config/feature_flags/experiment/group_only_trials_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..e410eb08d01723a4e7570db20333c6843d8249da --- /dev/null +++ b/ee/config/feature_flags/experiment/group_only_trials_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: group_only_trials_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40564 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/258629 +milestone: '13.5' +type: experiment +group: group::conversion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/invite_members_empty_group_version_a_experiment_percentage.yml b/ee/config/feature_flags/experiment/invite_members_empty_group_version_a_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..6f8186a6888bc969de40e2f1bd47b221d4da52bc --- /dev/null +++ b/ee/config/feature_flags/experiment/invite_members_empty_group_version_a_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: invite_members_empty_group_version_a_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45689 +rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/280 +milestone: '13.6' +type: experiment +group: group::expansion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/invite_members_empty_project_version_a_experiment_percentage.yml b/ee/config/feature_flags/experiment/invite_members_empty_project_version_a_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..8b91ec9526ccb4aeda7723138c21b4c23fa08dd4 --- /dev/null +++ b/ee/config/feature_flags/experiment/invite_members_empty_project_version_a_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: invite_members_empty_project_version_a_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49588 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/262014 +milestone: '13.7' +type: experiment +group: group::expansion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/invite_members_version_a_experiment_percentage.yml b/ee/config/feature_flags/experiment/invite_members_version_a_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..b284a0e2f78fcabc31b93cbc64ebfa4ed5033961 --- /dev/null +++ b/ee/config/feature_flags/experiment/invite_members_version_a_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: invite_members_version_a_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45689/ +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/219239 +milestone: '13.6' +type: experiment +group: group::expansion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/invite_members_version_b_experiment_percentage.yml b/ee/config/feature_flags/experiment/invite_members_version_b_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..069e740ba4408986f26f63bdf80597affb3a04a4 --- /dev/null +++ b/ee/config/feature_flags/experiment/invite_members_version_b_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: invite_members_version_b_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/43900 +rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/214 +milestone: '13.5' +type: experiment +group: group::expansion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/jobs_empty_state_experiment_percentage.yml b/ee/config/feature_flags/experiment/jobs_empty_state_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..33a15e28d445d0311690450dd40fbd00084a4cb9 --- /dev/null +++ b/ee/config/feature_flags/experiment/jobs_empty_state_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: jobs_empty_state_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48686 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/281054 +milestone: '13.7' +type: experiment +group: group::activation +default_enabled: false diff --git a/config/feature_flags/experiment/null_hypothesis.yml b/ee/config/feature_flags/experiment/null_hypothesis.yml similarity index 100% rename from config/feature_flags/experiment/null_hypothesis.yml rename to ee/config/feature_flags/experiment/null_hypothesis.yml diff --git a/ee/config/feature_flags/experiment/onboarding_issues_experiment_percentage.yml b/ee/config/feature_flags/experiment/onboarding_issues_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..7a8f3074d96c5e367bc3eb22c7907c0a3157c764 --- /dev/null +++ b/ee/config/feature_flags/experiment/onboarding_issues_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: onboarding_issues_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31656/ +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/224515 +milestone: '13.0' +type: experiment +group: group::conversion +default_enabled: true diff --git a/ee/config/feature_flags/experiment/remove_known_trial_form_fields_experiment_percentage.yml b/ee/config/feature_flags/experiment/remove_known_trial_form_fields_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..72b49a0423546e631d325711102f257aa8ec5f11 --- /dev/null +++ b/ee/config/feature_flags/experiment/remove_known_trial_form_fields_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: remove_known_trial_form_fields_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45634/ +rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/281 +milestone: '13.7' +type: experiment +group: group::conversion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/trial_registration_with_social_signin_experiment_percentage.yml b/ee/config/feature_flags/experiment/trial_registration_with_social_signin_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..e0f224ae0c45f796551a86be5570b14cf9d05ae8 --- /dev/null +++ b/ee/config/feature_flags/experiment/trial_registration_with_social_signin_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: trial_registration_with_social_signin_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45633 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/262853 +milestone: '13.7' +type: experiment +group: group::conversion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/trimmed_skip_trial_copy_experiment_percentage.yml b/ee/config/feature_flags/experiment/trimmed_skip_trial_copy_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..6e6e4555a6b5b523d06aa5ee436b02814eefe13f --- /dev/null +++ b/ee/config/feature_flags/experiment/trimmed_skip_trial_copy_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: trimmed_skip_trial_copy_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48110 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/284956 +milestone: '13.7' +type: experiment +group: group::conversion +default_enabled: false diff --git a/ee/config/feature_flags/experiment/upgrade_link_in_user_menu_a_experiment_percentage.yml b/ee/config/feature_flags/experiment/upgrade_link_in_user_menu_a_experiment_percentage.yml new file mode 100644 index 0000000000000000000000000000000000000000..e383e7040db39ef1a0eb86d6d300557a82124dd0 --- /dev/null +++ b/ee/config/feature_flags/experiment/upgrade_link_in_user_menu_a_experiment_percentage.yml @@ -0,0 +1,8 @@ +--- +name: upgrade_link_in_user_menu_a_experiment_percentage +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29428 +rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/126 +milestone: '13.0' +type: experiment +group: group::expansion +default_enabled: false diff --git a/lib/feature/shared.rb b/lib/feature/shared.rb index 17dfe26bd8276f6d096474050c43aae1cc205f9e..a3f02156d94b2c0981c75197fc05437714f1d5cd 100644 --- a/lib/feature/shared.rb +++ b/lib/feature/shared.rb @@ -57,6 +57,8 @@ class Feature default_enabled: false, example: <<-EOS experiment(:my_experiment, project: project, actor: current_user) { ...variant code... } + # or + Gitlab::Experimentation.in_experiment_group?(:my_experiment, subject: current_user) EOS } }.freeze diff --git a/lib/gitlab/experimentation/experiment.rb b/lib/gitlab/experimentation/experiment.rb index e594c3bedeb444fde9a1981c3024f3989d3570e5..b9eda0cfc3163bd8233c020e652ad9a3473ff14e 100644 --- a/lib/gitlab/experimentation/experiment.rb +++ b/lib/gitlab/experimentation/experiment.rb @@ -3,6 +3,8 @@ module Gitlab module Experimentation class Experiment + FEATURE_FLAG_SUFFIX = "_experiment_percentage" + attr_reader :key, :tracking_category, :use_backwards_compatible_subject_index def initialize(key, **params) @@ -10,7 +12,7 @@ module Gitlab @tracking_category = params[:tracking_category] @use_backwards_compatible_subject_index = params[:use_backwards_compatible_subject_index] - @experiment_percentage = Feature.get(:"#{key}_experiment_percentage").percentage_of_time_value # rubocop:disable Gitlab/AvoidFeatureGet + @experiment_percentage = Feature.get(:"#{key}#{FEATURE_FLAG_SUFFIX}").percentage_of_time_value # rubocop:disable Gitlab/AvoidFeatureGet end def active? diff --git a/spec/support/helpers/stub_experiments.rb b/spec/support/helpers/stub_experiments.rb index 247692d83ee3b07e087527406a6e03aac30fcce1..9188bc704c13656ac023ae1800d359c5a37d2e96 100644 --- a/spec/support/helpers/stub_experiments.rb +++ b/spec/support/helpers/stub_experiments.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true module StubExperiments + SUFFIX = Gitlab::Experimentation::Experiment::FEATURE_FLAG_SUFFIX + # Stub Experiment with `key: true/false` # # @param [Hash] experiment where key is feature name and value is boolean whether active or not. @@ -11,6 +13,7 @@ module StubExperiments allow(Gitlab::Experimentation).to receive(:active?).and_call_original experiments.each do |experiment_key, enabled| + Feature.persist_used!("#{experiment_key}#{SUFFIX}") allow(Gitlab::Experimentation).to receive(:active?).with(experiment_key) { enabled } end end @@ -25,6 +28,7 @@ module StubExperiments allow(Gitlab::Experimentation).to receive(:in_experiment_group?).and_call_original experiments.each do |experiment_key, enabled| + Feature.persist_used!("#{experiment_key}#{SUFFIX}") allow(Gitlab::Experimentation).to receive(:in_experiment_group?).with(experiment_key, anything) { enabled } end end