summaryrefslogtreecommitdiff
path: root/app/controllers/projects/pipelines_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/pipelines_controller.rb')
-rw-r--r--app/controllers/projects/pipelines_controller.rb39
1 files changed, 20 insertions, 19 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 74513da8675..e44c00e501e 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -17,10 +17,10 @@ class Projects::PipelinesController < Projects::ApplicationController
push_frontend_feature_flag(:new_pipeline_form, project, default_enabled: true)
push_frontend_feature_flag(:graphql_pipeline_header, project, type: :development, default_enabled: false)
push_frontend_feature_flag(:graphql_pipeline_details, project, type: :development, default_enabled: false)
- push_frontend_feature_flag(:graphql_pipeline_analytics, project, type: :development)
push_frontend_feature_flag(:new_pipeline_form_prefilled_vars, project, type: :development, default_enabled: true)
end
before_action :ensure_pipeline, only: [:show]
+ before_action :push_experiment_to_gon, only: :index, if: :html_request?
# Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/225596
before_action :redirect_for_legacy_scope_filter, only: [:index], if: -> { request.format.html? }
@@ -45,7 +45,11 @@ class Projects::PipelinesController < Projects::ApplicationController
@pipelines_count = limited_pipelines_count(project)
respond_to do |format|
- format.html
+ format.html do
+ record_empty_pipeline_experiment
+
+ render :index
+ end
format.json do
Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL)
@@ -184,23 +188,6 @@ class Projects::PipelinesController < Projects::ApplicationController
end
end
- def charts
- @charts = {}
- @counts = {}
-
- return if Feature.enabled?(:graphql_pipeline_analytics)
-
- @charts[:week] = Gitlab::Ci::Charts::WeekChart.new(project)
- @charts[:month] = Gitlab::Ci::Charts::MonthChart.new(project)
- @charts[:year] = Gitlab::Ci::Charts::YearChart.new(project)
- @charts[:pipeline_times] = Gitlab::Ci::Charts::PipelineTime.new(project)
-
- @counts[:total] = @project.all_pipelines.count(:all)
- @counts[:success] = @project.all_pipelines.success.count(:all)
- @counts[:failed] = @project.all_pipelines.failed.count(:all)
- @counts[:total_duration] = @project.all_pipelines.total_duration
- end
-
def test_report
respond_to do |format|
format.html do
@@ -313,6 +300,20 @@ class Projects::PipelinesController < Projects::ApplicationController
def index_params
params.permit(:scope, :username, :ref, :status)
end
+
+ def record_empty_pipeline_experiment
+ return unless @pipelines_count.to_i == 0
+ return if helpers.has_gitlab_ci?(@project)
+
+ record_experiment_user(:pipelines_empty_state)
+ end
+
+ def push_experiment_to_gon
+ return unless current_user
+
+ push_frontend_experiment(:pipelines_empty_state, subject: current_user)
+ frontend_experimentation_tracking_data(:pipelines_empty_state, 'view', project.namespace_id, subject: current_user)
+ end
end
Projects::PipelinesController.prepend_if_ee('EE::Projects::PipelinesController')