Commit 56b580b9 authored by Doug Stull's avatar Doug Stull

Merge branch 'jswain_publish_to_database_always_has_variant' into 'master'

Ensure variant when creating ExperimentSubjects

See merge request gitlab-org/gitlab!74943
parents 06479426 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!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment