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
b1f14036
Commit
b1f14036
authored
Nov 23, 2021
by
Jay
Committed by
Doug Stull
Nov 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure variant when creating ExperimentSubjects
parent
9d8d82ec
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
58 deletions
+70
-58
app/experiments/application_experiment.rb
app/experiments/application_experiment.rb
+2
-2
spec/experiments/application_experiment_spec.rb
spec/experiments/application_experiment_spec.rb
+68
-56
No files found.
app/experiments/application_experiment.rb
View file @
b1f14036
...
...
@@ -32,8 +32,8 @@ class ApplicationExperiment < Gitlab::Experiment # rubocop:disable Gitlab/Namesp
subject
=
value
[
:namespace
]
||
value
[
:group
]
||
value
[
:project
]
||
value
[
:user
]
||
value
[
:actor
]
return
unless
ExperimentSubject
.
valid_subject?
(
subject
)
variant
=
:experimental
if
@variant_name
!=
:control
Experiment
.
add_subject
(
name
,
variant:
variant
||
:control
,
subject:
subject
)
variant
_name
=
:experimental
if
variant
&
.
name
!=
'control'
Experiment
.
add_subject
(
name
,
variant:
variant
_name
||
:control
,
subject:
subject
)
end
def
record!
...
...
spec/experiments/application_experiment_spec.rb
View file @
b1f14036
This diff is collapsed.
Click to expand it.
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