diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-27 21:09:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-27 21:09:08 +0300 |
commit | 874d5e8019150bfb2428cac3089c1dac1d6f9ed9 (patch) | |
tree | 3a1d9b1828222fe16a5ca9071da34598c7280d50 /app/experiments/application_experiment.rb | |
parent | 0cbb4a75699e1ab6a0cb704b551e672e09192377 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/experiments/application_experiment.rb')
-rw-r--r-- | app/experiments/application_experiment.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/app/experiments/application_experiment.rb b/app/experiments/application_experiment.rb index 9a1a37a6b19..7a8851d11ce 100644 --- a/app/experiments/application_experiment.rb +++ b/app/experiments/application_experiment.rb @@ -1,20 +1,13 @@ # frozen_string_literal: true class ApplicationExperiment < Gitlab::Experiment - def enabled? - return false if Feature::Definition.get(name).nil? # there has to be a feature flag yaml file - return false unless Gitlab.dev_env_or_com? # we're in an environment that allows experiments - - Feature.get(name).state != :off # rubocop:disable Gitlab/AvoidFeatureGet - end - def publish(_result) track(:assignment) # track that we've assigned a variant for this context Gon.global.push({ experiment: { name => signature } }, true) # push to client end def track(action, **event_args) - return unless should_track? # no events for opted out actors or excluded subjects + return if excluded? # no events for opted out actors or excluded subjects Gitlab::Tracking.event(name, action.to_s, **event_args.merge( context: (event_args[:context] || []) << SnowplowTracker::SelfDescribingJson.new( |