diff options
Diffstat (limited to 'app/controllers/projects/pipelines_controller.rb')
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 9b5f5871c41..ee1e10221ec 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -4,7 +4,7 @@ class Projects::PipelinesController < Projects::ApplicationController include ::Gitlab::Utils::StrongMemoize include Analytics::UniqueVisitsHelper - before_action :whitelist_query_limiting, only: [:create, :retry] + before_action :disable_query_limiting, only: [:create, :retry] before_action :pipeline, except: [:index, :new, :create, :charts, :config_variables] before_action :set_pipeline_path, only: [:show] before_action :authorize_read_pipeline! @@ -14,10 +14,11 @@ class Projects::PipelinesController < Projects::ApplicationController before_action :authorize_update_pipeline!, only: [:retry, :cancel] before_action do push_frontend_feature_flag(:new_pipeline_form, project, default_enabled: :yaml) + push_frontend_feature_flag(:pipeline_graph_layers_view, project, type: :development, default_enabled: :yaml) + push_frontend_feature_flag(:pipeline_filter_jobs, project, default_enabled: :yaml) push_frontend_feature_flag(:graphql_pipeline_details, project, type: :development, default_enabled: :yaml) push_frontend_feature_flag(:graphql_pipeline_details_users, current_user, type: :development, default_enabled: :yaml) push_frontend_feature_flag(:jira_for_vulnerabilities, project, type: :development, default_enabled: :yaml) - push_frontend_feature_flag(:new_pipelines_table, project, default_enabled: :yaml) end before_action :ensure_pipeline, only: [:show] @@ -44,7 +45,17 @@ class Projects::PipelinesController < Projects::ApplicationController @pipelines_count = limited_pipelines_count(project) respond_to do |format| - format.html + 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 + end format.json do Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL) @@ -92,10 +103,10 @@ class Projects::PipelinesController < Projects::ApplicationController end def show - Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab/-/issues/26657') + Gitlab::QueryLimiting.disable!('https://gitlab.com/gitlab-org/gitlab/-/issues/26657') respond_to do |format| - format.html + format.html { render_show } format.json do Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL) @@ -150,15 +161,6 @@ class Projects::PipelinesController < Projects::ApplicationController .represent(@stage, details: true, retried: params[:retried]) end - # TODO: This endpoint is used by mini-pipeline-graph - # TODO: This endpoint should be migrated to `stage.json` - def stage_ajax - @stage = pipeline.legacy_stage(params[:stage]) - return not_found unless @stage - - render json: { html: view_to_html_string('projects/pipelines/_stage') } - end - def retry pipeline.retry_failed(current_user) @@ -185,10 +187,7 @@ class Projects::PipelinesController < Projects::ApplicationController def test_report respond_to do |format| - format.html do - render 'show' - end - + format.html { render_show } format.json do render json: TestReportSerializer .new(current_user: @current_user) @@ -217,6 +216,8 @@ class Projects::PipelinesController < Projects::ApplicationController end def render_show + @stages = @pipeline.stages.with_latest_and_retried_statuses + respond_to do |format| format.html do render 'show' @@ -269,9 +270,9 @@ class Projects::PipelinesController < Projects::ApplicationController &.present(current_user: current_user) end - def whitelist_query_limiting - # Also see https://gitlab.com/gitlab-org/gitlab-foss/issues/42343 - Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-foss/issues/42339') + def disable_query_limiting + # Also see https://gitlab.com/gitlab-org/gitlab/-/issues/20785 + Gitlab::QueryLimiting.disable!('https://gitlab.com/gitlab-org/gitlab/-/issues/20784') end def authorize_update_pipeline! |