Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/pipelines_controller.rb')
-rw-r--r--app/controllers/projects/pipelines_controller.rb68
1 files changed, 43 insertions, 25 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 0de8dc597ae..7779f3c3b65 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -49,26 +49,9 @@ class Projects::PipelinesController < Projects::ApplicationController
respond_to do |format|
format.html do
- experiment(:pipeline_empty_state_templates, actor: current_user) do |e|
- e.exclude! unless current_user
- e.exclude! if @pipelines_count.to_i > 0
- e.exclude! if helpers.has_gitlab_ci?(project)
-
- e.use {}
- e.try {}
- e.track(:view, value: project.namespace_id)
- end
- experiment(:code_quality_walkthrough, namespace: project.root_ancestor) do |e|
- e.exclude! unless current_user
- e.exclude! unless can?(current_user, :create_pipeline, project)
- e.exclude! unless project.root_ancestor.recent?
- e.exclude! if @pipelines_count.to_i > 0
- e.exclude! if helpers.has_gitlab_ci?(project)
-
- e.use {}
- e.try {}
- e.track(:view, property: project.root_ancestor.id.to_s)
- end
+ enable_pipeline_empty_state_templates_experiment
+ enable_code_quality_walkthrough_experiment
+ enable_ci_runner_templates_experiment
end
format.json do
Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL)
@@ -176,11 +159,7 @@ class Projects::PipelinesController < Projects::ApplicationController
end
def retry
- if Gitlab::Ci::Features.background_pipeline_retry_endpoint?(@project)
- ::Ci::RetryPipelineWorker.perform_async(pipeline.id, current_user.id) # rubocop:disable CodeReuse/Worker
- else
- pipeline.retry_failed(current_user)
- end
+ ::Ci::RetryPipelineWorker.perform_async(pipeline.id, current_user.id) # rubocop:disable CodeReuse/Worker
respond_to do |format|
format.html do
@@ -321,6 +300,45 @@ class Projects::PipelinesController < Projects::ApplicationController
def index_params
params.permit(:scope, :username, :ref, :status)
end
+
+ def enable_pipeline_empty_state_templates_experiment
+ experiment(:pipeline_empty_state_templates, namespace: project.root_ancestor) do |e|
+ e.exclude! unless current_user
+ e.exclude! if @pipelines_count.to_i > 0
+ e.exclude! if helpers.has_gitlab_ci?(project)
+
+ e.control {}
+ e.candidate {}
+ e.record!
+ end
+ end
+
+ def enable_code_quality_walkthrough_experiment
+ experiment(:code_quality_walkthrough, namespace: project.root_ancestor) do |e|
+ e.exclude! unless current_user
+ e.exclude! unless can?(current_user, :create_pipeline, project)
+ e.exclude! unless project.root_ancestor.recent?
+ e.exclude! if @pipelines_count.to_i > 0
+ e.exclude! if helpers.has_gitlab_ci?(project)
+
+ e.control {}
+ e.candidate {}
+ e.record!
+ end
+ end
+
+ def enable_ci_runner_templates_experiment
+ experiment(:ci_runner_templates, namespace: project.root_ancestor) do |e|
+ e.exclude! unless current_user
+ e.exclude! unless can?(current_user, :create_pipeline, project)
+ e.exclude! if @pipelines_count.to_i > 0
+ e.exclude! if helpers.has_gitlab_ci?(project)
+
+ e.control {}
+ e.candidate {}
+ e.record!
+ end
+ end
end
Projects::PipelinesController.prepend_mod_with('Projects::PipelinesController')