summaryrefslogtreecommitdiff
path: root/app/controllers/projects/blob_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/blob_controller.rb')
-rw-r--r--app/controllers/projects/blob_controller.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index 3bb00978aac..0080ae1a5be 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -31,9 +31,7 @@ class Projects::BlobController < Projects::ApplicationController
before_action :editor_variables, except: [:show, :preview, :diff]
before_action :validate_diff_params, only: :diff
before_action :set_last_commit_sha, only: [:edit, :update]
- before_action only: :new do
- record_experiment_user(:ci_syntax_templates, namespace_id: @project.namespace_id) if params[:file_name] == @project.ci_config_path_or_default
- end
+ before_action :record_experiment, only: :new
track_redis_hll_event :create, :update, name: 'g_edit_by_sfe'
@@ -263,4 +261,10 @@ class Projects::BlobController < Projects::ApplicationController
def visitor_id
current_user&.id
end
+
+ def record_experiment
+ return unless params[:file_name] == @project.ci_config_path_or_default && @project.namespace.recent?
+
+ record_experiment_user(:ci_syntax_templates_b, namespace_id: @project.namespace_id)
+ end
end