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
b366b92c
Commit
b366b92c
authored
Feb 03, 2022
by
eugielimpin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use control/candidate/variant(:name) instead of use/try/try(:name)
use, try, and try(:variant_name) are now deprecated
parent
d1f7c562
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
28 additions
and
28 deletions
+28
-28
app/controllers/groups/boards_controller.rb
app/controllers/groups/boards_controller.rb
+2
-2
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+2
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-1
app/helpers/ide_helper.rb
app/helpers/ide_helper.rb
+1
-1
app/helpers/learn_gitlab_helper.rb
app/helpers/learn_gitlab_helper.rb
+2
-2
app/views/projects/_new_project_fields.html.haml
app/views/projects/_new_project_fields.html.haml
+4
-4
ee/app/helpers/ee/registrations_helper.rb
ee/app/helpers/ee/registrations_helper.rb
+2
-2
ee/app/helpers/paid_feature_callout_helper.rb
ee/app/helpers/paid_feature_callout_helper.rb
+2
-2
ee/app/helpers/projects/security/discover_helper.rb
ee/app/helpers/projects/security/discover_helper.rb
+2
-2
ee/app/helpers/trial_status_widget_helper.rb
ee/app/helpers/trial_status_widget_helper.rb
+1
-1
ee/app/views/shared/issuable/_approver_suggestion.haml
ee/app/views/shared/issuable/_approver_suggestion.haml
+1
-1
ee/lib/api/experiments.rb
ee/lib/api/experiments.rb
+2
-2
spec/experiments/application_experiment_spec.rb
spec/experiments/application_experiment_spec.rb
+4
-4
spec/features/gitlab_experiments_spec.rb
spec/features/gitlab_experiments_spec.rb
+2
-2
No files found.
app/controllers/groups/boards_controller.rb
View file @
b366b92c
...
...
@@ -11,8 +11,8 @@ class Groups::BoardsController < Groups::ApplicationController
push_frontend_feature_flag
(
:board_multi_select
,
group
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:iteration_cadences
,
group
,
default_enabled: :yaml
)
experiment
(
:prominent_create_board_btn
,
subject:
current_user
)
do
|
e
|
e
.
use
{
}
e
.
try
{
}
e
.
control
{
}
e
.
candidate
{
}
end
.
run
end
...
...
app/controllers/projects/boards_controller.rb
View file @
b366b92c
...
...
@@ -11,8 +11,8 @@ class Projects::BoardsController < Projects::ApplicationController
push_frontend_feature_flag
(
:board_multi_select
,
project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:iteration_cadences
,
project
&
.
group
,
default_enabled: :yaml
)
experiment
(
:prominent_create_board_btn
,
subject:
current_user
)
do
|
e
|
e
.
use
{
}
e
.
try
{
}
e
.
control
{
}
e
.
candidate
{
}
end
.
run
end
...
...
app/helpers/application_helper.rb
View file @
b366b92c
...
...
@@ -428,7 +428,7 @@ module ApplicationHelper
experiment
(
:logged_out_marketing_header
,
actor:
nil
)
do
|
e
|
html_class
=
'logged-out-marketing-header-candidate'
e
.
candidate
{
html_class
}
e
.
try
(
:trial_focused
)
{
html_class
}
e
.
variant
(
:trial_focused
)
{
html_class
}
e
.
control
{}
e
.
run
end
...
...
app/helpers/ide_helper.rb
View file @
b366b92c
...
...
@@ -34,7 +34,7 @@ module IdeHelper
def
enable_environments_guidance?
experiment
(
:in_product_guidance_environments_webide
,
project:
@project
)
do
|
e
|
e
.
try
{
!
has_dismissed_ide_environments_callout?
}
e
.
candidate
{
!
has_dismissed_ide_environments_callout?
}
e
.
run
end
...
...
app/helpers/learn_gitlab_helper.rb
View file @
b366b92c
...
...
@@ -33,8 +33,8 @@ module LearnGitlabHelper
actor:
current_user
,
sticky_to:
project
.
namespace
)
do
|
e
|
e
.
use
{
urls_to_use
=
action_urls
}
e
.
try
{
urls_to_use
=
new_action_urls
(
project
)
}
e
.
control
{
urls_to_use
=
action_urls
}
e
.
candidate
{
urls_to_use
=
new_action_urls
(
project
)
}
end
urls_to_use
.
to_h
do
|
action
,
url
|
...
...
app/views/projects/_new_project_fields.html.haml
View file @
b366b92c
...
...
@@ -63,13 +63,13 @@
=
s_
(
'ProjectsNew|Allows you to immediately clone this project’s repository. Skip this if you plan to push up an existing repository.'
)
-
experiment
(
:new_project_sast_enabled
,
user:
current_user
)
do
|
e
|
-
e
.
try
(
:candidate
)
do
-
e
.
variant
(
:candidate
)
do
=
render
'new_project_initialize_with_sast'
,
experiment_name:
e
.
name
,
track_label:
track_label
,
checked:
true
,
with_free_badge:
false
-
e
.
try
(
:unchecked_candidate
)
do
-
e
.
variant
(
:unchecked_candidate
)
do
=
render
'new_project_initialize_with_sast'
,
experiment_name:
e
.
name
,
track_label:
track_label
,
checked:
false
,
with_free_badge:
false
-
e
.
try
(
:free_indicator
)
do
-
e
.
variant
(
:free_indicator
)
do
=
render
'new_project_initialize_with_sast'
,
experiment_name:
e
.
name
,
track_label:
track_label
,
checked:
true
,
with_free_badge:
true
-
e
.
try
(
:unchecked_free_indicator
)
do
-
e
.
variant
(
:unchecked_free_indicator
)
do
=
render
'new_project_initialize_with_sast'
,
experiment_name:
e
.
name
,
track_label:
track_label
,
checked:
false
,
with_free_badge:
true
=
f
.
submit
_
(
'Create project'
),
class:
"btn gl-button btn-confirm"
,
data:
{
track_label:
"
#{
track_label
}
"
,
track_action:
"click_button"
,
track_property:
"create_project"
,
track_value:
""
}
...
...
ee/app/helpers/ee/registrations_helper.rb
View file @
b366b92c
...
...
@@ -59,12 +59,12 @@ module EE
options
=
localized_jobs_to_be_done_choices
.
dup
experiment
(
:bypass_registration
,
user:
current_user
)
do
|
e
|
e
.
use
do
e
.
control
do
options
.
merge
(
joining_team:
_
(
'I’m joining my team who’s already on GitLab'
)
)
end
e
.
try
do
e
.
candidate
do
options
end
e
.
run
...
...
ee/app/helpers/paid_feature_callout_helper.rb
View file @
b366b92c
...
...
@@ -8,8 +8,8 @@ module PaidFeatureCalloutHelper
experiment
(
:highlight_paid_features_during_active_trial
,
group:
group
)
do
|
e
|
e
.
exclude!
unless
billing_plans_and_trials_available?
e
.
exclude!
unless
group
&&
eligible_for_trial_upgrade_callout?
(
group
)
e
.
use
{
nil
}
# control gets nothing new added to the existing UI
e
.
try
(
&
block
)
e
.
control
{
nil
}
# control gets nothing new added to the existing UI
e
.
candidate
(
&
block
)
e
.
publish_to_database
end
end
...
...
ee/app/helpers/projects/security/discover_helper.rb
View file @
b366b92c
...
...
@@ -3,8 +3,8 @@
module
Projects::Security::DiscoverHelper
def
pql_three_cta_test_experiment_candidate?
(
namespace
)
experiment
(
:pql_three_cta_test
,
namespace:
namespace
)
do
|
e
|
e
.
use
{
false
}
e
.
try
{
true
}
e
.
control
{
false
}
e
.
candidate
{
true
}
end
.
run
end
...
...
ee/app/helpers/trial_status_widget_helper.rb
View file @
b366b92c
...
...
@@ -53,7 +53,7 @@ module TrialStatusWidgetHelper
force_popover
=
false
experiment
(
:forcibly_show_trial_status_popover
,
group:
group
)
do
|
e
|
e
.
try
do
e
.
candidate
do
force_popover
=
!
dismissed_feature_callout?
(
current_user_callout_feature_id
(
group
.
trial_days_remaining
)
)
...
...
ee/app/views/shared/issuable/_approver_suggestion.haml
View file @
b366b92c
...
...
@@ -22,7 +22,7 @@
-
top_level_namespace
=
@target_project
.
root_ancestor
-
if
can?
(
current_user
,
:admin_group
,
top_level_namespace
)
-
experiment
(
:promote_mr_approvals_in_free
,
namespace:
top_level_namespace
,
user:
current_user
,
sticky_to:
current_user
)
do
|
e
|
-
e
.
try
do
-
e
.
candidate
do
#js-mr-approvals-promo
{
data:
{
try_now_path:
new_trial_path
,
learn_more_path:
help_page_path
(
'user/project/merge_requests/approvals/index'
),
promo_image_path:
image_path
(
'illustrations/merge_requests.svg'
),
...
...
ee/lib/api/experiments.rb
View file @
b366b92c
...
...
@@ -14,8 +14,8 @@ module API
experiments
=
[]
experiment
(
:null_hypothesis
,
canary:
true
,
user:
current_user
)
do
|
e
|
e
.
use
{
bad_request!
'experimentation may not be working right now'
}
e
.
try
do
e
.
control
{
bad_request!
'experimentation may not be working right now'
}
e
.
candidate
do
experiments
=
Feature
::
Definition
.
definitions
.
values
.
select
{
|
d
|
d
.
attributes
[
:type
]
==
'experiment'
}
end
end
...
...
spec/experiments/application_experiment_spec.rb
View file @
b366b92c
...
...
@@ -359,8 +359,8 @@ RSpec.describe ApplicationExperiment, :experiment do
end
it
"returns an assigned name"
do
application_experiment
.
try
(
:variant1
)
{}
application_experiment
.
try
(
:variant2
)
{}
application_experiment
.
variant
(
:variant1
)
{}
application_experiment
.
variant
(
:variant2
)
{}
expect
(
application_experiment
.
variant
.
name
).
to
eq
(
'variant2'
)
end
...
...
@@ -395,8 +395,8 @@ RSpec.describe ApplicationExperiment, :experiment do
cache
.
clear
(
key:
application_experiment
.
name
)
application_experiment
.
use
{
}
# setup the control
application_experiment
.
try
{
}
# setup the candidate
application_experiment
.
control
{
}
application_experiment
.
candidate
{
}
end
it
"caches the variant determined by the variant resolver"
do
...
...
spec/features/gitlab_experiments_spec.rb
View file @
b366b92c
...
...
@@ -21,8 +21,8 @@ RSpec.describe "Gitlab::Experiment", :js do
allow_next_instance_of
(
Admin
::
AbuseReportsController
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:index
).
and_wrap_original
do
|
original
|
instance
.
experiment
(
:null_hypothesis
,
user:
instance
.
current_user
)
do
|
e
|
e
.
use
{
original
.
call
}
e
.
try
{
original
.
call
}
e
.
control
{
original
.
call
}
e
.
candidate
{
original
.
call
}
end
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