Commit 367e7520 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'leipert-get-rid-of-unneeded-commit' into 'master'

Get rid of unnecessary commit action in pipelines controller

See merge request gitlab-org/gitlab-ce!20980
parents f5b9e287 14e88565
class Projects::PipelinesController < Projects::ApplicationController
before_action :whitelist_query_limiting, only: [:create, :retry]
before_action :pipeline, except: [:index, :new, :create, :charts]
before_action :commit, only: [:show, :builds, :failures]
before_action :authorize_read_pipeline!
before_action :authorize_create_pipeline!, only: [:new, :create]
before_action :authorize_update_pipeline!, only: [:retry, :cancel]
......@@ -168,10 +167,6 @@ class Projects::PipelinesController < Projects::ApplicationController
.present(current_user: current_user)
end
def commit
@commit ||= @pipeline.commit
end
def whitelist_query_limiting
# Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/42343
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42339')
......
#js-pipeline-header-vue.pipeline-header-container
- if @commit.present?
.commit-box
.commit-box
%h3.commit-title
= markdown(@commit.title, pipeline: :single_line)
- if @commit.description.present?
= markdown(commit.title, pipeline: :single_line)
- if commit.description.present?
.commit-description<
= preserve(markdown(@commit.description, pipeline: :single_line))
= preserve(markdown(commit.description, pipeline: :single_line))
.info-well
- if @commit.status
.info-well
- if commit.status
.well-segment.pipeline-info
.icon-container
= icon('clock-o')
......@@ -26,7 +23,7 @@
.well-segment.branch-info
.icon-container.commit-icon
= custom_icon("icon_commit")
= link_to @commit.short_id, project_commit_path(@project, @pipeline.sha), class: "commit-sha js-details-short"
= link_to commit.short_id, project_commit_path(@project, @pipeline.sha), class: "commit-sha js-details-short"
= link_to("#", class: "js-details-expand d-none d-sm-none d-md-inline") do
%span.text-expander
= sprite_icon('ellipsis_h', size: 12)
......
......@@ -4,8 +4,10 @@
- page_title "Pipeline"
.js-pipeline-container{ class: container_class, data: { controller_action: "#{controller.action_name}" } }
- if @commit
= render "projects/pipelines/info"
#js-pipeline-header-vue.pipeline-header-container
- if @pipeline.commit.present?
= render "projects/pipelines/info", commit: @pipeline.commit
= render "projects/pipelines/with_tabs", pipeline: @pipeline
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment