From 71a67d17b02e7b8dec2f4c257f6734dc7818fb1e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 12 May 2021 12:10:24 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/controllers/projects/blob_controller.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'app/controllers/projects/blob_controller.rb') diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index cbee33853bb..dbe628cb43a 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -31,6 +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 :track_experiment, only: :create track_redis_hll_event :create, :update, name: 'g_edit_by_sfe' @@ -46,7 +47,7 @@ class Projects::BlobController < Projects::ApplicationController def create create_commit(Files::CreateService, success_notice: _("The file has been successfully created."), - success_path: -> { project_blob_path(@project, File.join(@branch_name, @file_path)) }, + success_path: -> { create_success_path }, failure_view: :new, failure_path: project_new_blob_path(@project, @ref)) end @@ -264,4 +265,18 @@ class Projects::BlobController < Projects::ApplicationController def visitor_id current_user&.id end + + def create_success_path + if params[:code_quality_walkthrough] + project_pipelines_path(@project, code_quality_walkthrough: true) + else + project_blob_path(@project, File.join(@branch_name, @file_path)) + end + end + + def track_experiment + return unless params[:code_quality_walkthrough] + + experiment(:code_quality_walkthrough, namespace: @project.root_ancestor).track(:commit_created) + end end -- cgit v1.2.1