Skip to content

Add control and candidate methods

Nicolas Dular requested to merge nicolasdular/alias-use-and-try into master

Issue: https://gitlab.com/gitlab-org/gitlab-experiment/-/issues/26

Since use and try is not a very common terminology and we refer to control and candidate often when conducting experiments, this code also aligns the experiment methods.

Before

experiment(:example) do |e|
  e.use { red_button }
  e.try { blue_button }
end

After

experiment(:example) do |e|
  e.control { red_button }
  e.candidate { blue_button }
end

Additional information

It is still possible to use use and try, but we will likely deprecate it.

You can also use multiple candidates with a name. E.g.

experiment(:example) do |e|
  e.control { red_button }
  e.candidate(:blue) { blue_button }
  e.candidate(:green) { green_button }
end

Edited by Nicolas Dular

Merge request reports