Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
606586d6
Commit
606586d6
authored
Jan 05, 2021
by
Dallas Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Revert "Merge branch '294462-fix-reinstate-49244' into 'master'""
This reverts commit
579baf6b
.
parent
3948f4d2
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
199 additions
and
5 deletions
+199
-5
ee/config/feature_flags/experiment/ci_notification_dot_experiment_percentage.yml
.../experiment/ci_notification_dot_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/ci_syntax_templates_experiment_percentage.yml
.../experiment/ci_syntax_templates_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/contact_sales_btn_in_app_experiment_percentage.yml
...riment/contact_sales_btn_in_app_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/customize_homepage_experiment_percentage.yml
...s/experiment/customize_homepage_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/default_to_issues_board_experiment_percentage.yml
...eriment/default_to_issues_board_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/group_only_trials_experiment_percentage.yml
...gs/experiment/group_only_trials_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/invite_members_empty_group_version_a_experiment_percentage.yml
...e_members_empty_group_version_a_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/invite_members_empty_project_version_a_experiment_percentage.yml
...members_empty_project_version_a_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/invite_members_new_dropdown_experiment_percentage.yml
...ent/invite_members_new_dropdown_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/invite_members_version_a_experiment_percentage.yml
...riment/invite_members_version_a_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/invite_members_version_b_experiment_percentage.yml
...riment/invite_members_version_b_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/jobs_empty_state_experiment_percentage.yml
...ags/experiment/jobs_empty_state_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/null_hypothesis.yml
ee/config/feature_flags/experiment/null_hypothesis.yml
+0
-0
ee/config/feature_flags/experiment/onboarding_issues_experiment_percentage.yml
...gs/experiment/onboarding_issues_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/pipelines_empty_state_experiment_percentage.yml
...xperiment/pipelines_empty_state_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/remove_known_trial_form_fields_experiment_percentage.yml
.../remove_known_trial_form_fields_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/trial_during_signup_experiment_percentage.yml
.../experiment/trial_during_signup_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/trial_onboarding_issues_experiment_percentage.yml
...eriment/trial_onboarding_issues_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/trial_registration_with_social_signin_experiment_percentage.yml
...registration_with_social_signin_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/trimmed_skip_trial_copy_experiment_percentage.yml
...eriment/trimmed_skip_trial_copy_experiment_percentage.yml
+8
-0
ee/config/feature_flags/experiment/upgrade_link_in_user_menu_a_experiment_percentage.yml
...ent/upgrade_link_in_user_menu_a_experiment_percentage.yml
+8
-0
ee/spec/requests/api/experiments_spec.rb
ee/spec/requests/api/experiments_spec.rb
+2
-0
lib/feature/shared.rb
lib/feature/shared.rb
+2
-0
lib/gitlab/experimentation/experiment.rb
lib/gitlab/experimentation/experiment.rb
+17
-3
spec/lib/gitlab/experimentation/experiment_spec.rb
spec/lib/gitlab/experimentation/experiment_spec.rb
+4
-2
spec/lib/gitlab/experimentation_spec.rb
spec/lib/gitlab/experimentation_spec.rb
+2
-0
spec/support/helpers/stub_experiments.rb
spec/support/helpers/stub_experiments.rb
+8
-0
spec/support/helpers/stub_feature_flags.rb
spec/support/helpers/stub_feature_flags.rb
+4
-0
No files found.
ee/config/feature_flags/experiment/ci_notification_dot_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/ci_syntax_templates_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
name
:
ci_syntax_templates_experiment_percentage
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48141
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/281057
milestone
:
'
13.8'
type
:
experiment
group
:
group::activation
default_enabled
:
false
ee/config/feature_flags/experiment/contact_sales_btn_in_app_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/customize_homepage_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/default_to_issues_board_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/group_only_trials_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/invite_members_empty_group_version_a_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/invite_members_empty_project_version_a_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/invite_members_new_dropdown_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
name
:
invite_members_new_dropdown_experiment_percentage
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50069
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/268129
milestone
:
'
13.8'
type
:
experiment
group
:
group::expansion
default_enabled
:
false
ee/config/feature_flags/experiment/invite_members_version_a_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/invite_members_version_b_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/jobs_empty_state_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
config/feature_flags/experiment/null_hypothesis.yml
→
ee/
config/feature_flags/experiment/null_hypothesis.yml
View file @
606586d6
File moved
ee/config/feature_flags/experiment/onboarding_issues_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/pipelines_empty_state_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
name
:
pipelines_empty_state_experiment_percentage
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47952
rollout_issue_url
:
https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/289
milestone
:
'
13.8'
type
:
experiment
group
:
group::activation
default_enabled
:
false
ee/config/feature_flags/experiment/remove_known_trial_form_fields_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/trial_during_signup_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
name
:
trial_during_signup_experiment_percentage
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45147/
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/251231
milestone
:
'
13.8'
type
:
experiment
group
:
group::conversion
default_enabled
:
false
ee/config/feature_flags/experiment/trial_onboarding_issues_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
name
:
trial_onboarding_issues_experiment_percentage
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48052
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/276703
milestone
:
'
13.8'
type
:
experiment
group
:
group::conversion
default_enabled
:
false
ee/config/feature_flags/experiment/trial_registration_with_social_signin_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/trimmed_skip_trial_copy_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/config/feature_flags/experiment/upgrade_link_in_user_menu_a_experiment_percentage.yml
0 → 100644
View file @
606586d6
---
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
ee/spec/requests/api/experiments_spec.rb
View file @
606586d6
...
...
@@ -20,6 +20,8 @@ RSpec.describe API::Experiments do
end
before
do
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
stub_const
(
'Gitlab::Experimentation::EXPERIMENTS'
,
experiments
)
Feature
.
enable_percentage_of_time
(
'experiment_1_experiment_percentage'
,
10
)
Feature
.
disable
(
'experiment_2_experiment_percentage'
)
...
...
lib/feature/shared.rb
View file @
606586d6
...
...
@@ -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
...
...
lib/gitlab/experimentation/experiment.rb
View file @
606586d6
...
...
@@ -3,17 +3,21 @@
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
)
@key
=
key
@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
end
def
active?
# TODO: just touch a feature flag
# Temporary change, we will change `experiment_percentage` in future to `Feature.enabled?
Feature
.
enabled?
(
feature_flag_name
,
type: :experiment
,
default_enabled: :yaml
)
::
Gitlab
.
dev_env_or_com?
&&
experiment_percentage
>
0
end
...
...
@@ -25,7 +29,17 @@ module Gitlab
private
attr_reader
:experiment_percentage
def
experiment_percentage
feature_flag
.
percentage_of_time_value
end
def
feature_flag
Feature
.
get
(
feature_flag_name
)
# rubocop:disable Gitlab/AvoidFeatureGet
end
def
feature_flag_name
:"
#{
key
}#{
FEATURE_FLAG_SUFFIX
}
"
end
end
end
end
spec/lib/gitlab/experimentation/experiment_spec.rb
View file @
606586d6
...
...
@@ -14,8 +14,10 @@ RSpec.describe Gitlab::Experimentation::Experiment do
end
before
do
feature
=
double
(
'FeatureFlag'
,
percentage_of_time_value:
percentage
)
expect
(
Feature
).
to
receive
(
:get
).
with
(
:experiment_key_experiment_percentage
).
and_return
(
feature
)
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
feature
=
double
(
'FeatureFlag'
,
percentage_of_time_value:
percentage
,
enabled?:
true
)
allow
(
Feature
).
to
receive
(
:get
).
with
(
:experiment_key_experiment_percentage
).
and_return
(
feature
)
end
subject
(
:experiment
)
{
described_class
.
new
(
:experiment_key
,
**
params
)
}
...
...
spec/lib/gitlab/experimentation_spec.rb
View file @
606586d6
...
...
@@ -38,6 +38,8 @@ RSpec.describe Gitlab::Experimentation do
}
})
skip_feature_flags_yaml_validation
skip_default_enabled_yaml_check
Feature
.
enable_percentage_of_time
(
:backwards_compatible_test_experiment_experiment_percentage
,
enabled_percentage
)
Feature
.
enable_percentage_of_time
(
:test_experiment_experiment_percentage
,
enabled_percentage
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
...
...
spec/support/helpers/stub_experiments.rb
View file @
606586d6
...
...
@@ -11,6 +11,7 @@ module StubExperiments
allow
(
Gitlab
::
Experimentation
).
to
receive
(
:active?
).
and_call_original
experiments
.
each
do
|
experiment_key
,
enabled
|
Feature
.
persist_used!
(
"
#{
experiment_key
}#{
feature_flag_suffix
}
"
)
allow
(
Gitlab
::
Experimentation
).
to
receive
(
:active?
).
with
(
experiment_key
)
{
enabled
}
end
end
...
...
@@ -25,7 +26,14 @@ module StubExperiments
allow
(
Gitlab
::
Experimentation
).
to
receive
(
:in_experiment_group?
).
and_call_original
experiments
.
each
do
|
experiment_key
,
enabled
|
Feature
.
persist_used!
(
"
#{
experiment_key
}#{
feature_flag_suffix
}
"
)
allow
(
Gitlab
::
Experimentation
).
to
receive
(
:in_experiment_group?
).
with
(
experiment_key
,
anything
)
{
enabled
}
end
end
private
def
feature_flag_suffix
Gitlab
::
Experimentation
::
Experiment
::
FEATURE_FLAG_SUFFIX
end
end
spec/support/helpers/stub_feature_flags.rb
View file @
606586d6
...
...
@@ -66,4 +66,8 @@ module StubFeatureFlags
def
skip_feature_flags_yaml_validation
allow
(
Feature
::
Definition
).
to
receive
(
:valid_usage!
)
end
def
skip_default_enabled_yaml_check
allow
(
Feature
::
Definition
).
to
receive
(
:default_enabled?
).
and_return
(
false
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment