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 class Projects::PipelinesController < Projects::ApplicationController
before_action :whitelist_query_limiting, only: [:create, :retry] before_action :whitelist_query_limiting, only: [:create, :retry]
before_action :pipeline, except: [:index, :new, :create, :charts] before_action :pipeline, except: [:index, :new, :create, :charts]
before_action :commit, only: [:show, :builds, :failures]
before_action :authorize_read_pipeline! before_action :authorize_read_pipeline!
before_action :authorize_create_pipeline!, only: [:new, :create] before_action :authorize_create_pipeline!, only: [:new, :create]
before_action :authorize_update_pipeline!, only: [:retry, :cancel] before_action :authorize_update_pipeline!, only: [:retry, :cancel]
...@@ -168,10 +167,6 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -168,10 +167,6 @@ class Projects::PipelinesController < Projects::ApplicationController
.present(current_user: current_user) .present(current_user: current_user)
end end
def commit
@commit ||= @pipeline.commit
end
def whitelist_query_limiting def whitelist_query_limiting
# Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/42343 # Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/42343
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42339') Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42339')
......
#js-pipeline-header-vue.pipeline-header-container .commit-box
- if @commit.present?
.commit-box
%h3.commit-title %h3.commit-title
= markdown(@commit.title, pipeline: :single_line) = markdown(commit.title, pipeline: :single_line)
- if @commit.description.present? - if commit.description.present?
.commit-description< .commit-description<
= preserve(markdown(@commit.description, pipeline: :single_line)) = preserve(markdown(commit.description, pipeline: :single_line))
.info-well .info-well
- if @commit.status - if commit.status
.well-segment.pipeline-info .well-segment.pipeline-info
.icon-container .icon-container
= icon('clock-o') = icon('clock-o')
...@@ -26,7 +23,7 @@ ...@@ -26,7 +23,7 @@
.well-segment.branch-info .well-segment.branch-info
.icon-container.commit-icon .icon-container.commit-icon
= custom_icon("icon_commit") = 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 = link_to("#", class: "js-details-expand d-none d-sm-none d-md-inline") do
%span.text-expander %span.text-expander
= sprite_icon('ellipsis_h', size: 12) = sprite_icon('ellipsis_h', size: 12)
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
- page_title "Pipeline" - page_title "Pipeline"
.js-pipeline-container{ class: container_class, data: { controller_action: "#{controller.action_name}" } } .js-pipeline-container{ class: container_class, data: { controller_action: "#{controller.action_name}" } }
- if @commit #js-pipeline-header-vue.pipeline-header-container
= render "projects/pipelines/info"
- if @pipeline.commit.present?
= render "projects/pipelines/info", commit: @pipeline.commit
= render "projects/pipelines/with_tabs", pipeline: @pipeline = 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