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
%h3.commit-title
= markdown(commit.title, pipeline: :single_line)
- if commit.description.present?
.commit-description<
= preserve(markdown(commit.description, pipeline: :single_line))
- if @commit.present? .info-well
.commit-box - if commit.status
%h3.commit-title .well-segment.pipeline-info
= markdown(@commit.title, pipeline: :single_line) .icon-container
- if @commit.description.present? = icon('clock-o')
.commit-description< = pluralize @pipeline.total_size, "job"
= preserve(markdown(@commit.description, pipeline: :single_line)) - if @pipeline.ref
from
= link_to @pipeline.ref, project_ref_path(@project, @pipeline.ref), class: "ref-name"
- if @pipeline.duration
in
= time_interval_in_words(@pipeline.duration)
- if @pipeline.queued_duration
= "(queued for #{time_interval_in_words(@pipeline.queued_duration)})"
.info-well .well-segment.branch-info
- if @commit.status .icon-container.commit-icon
.well-segment.pipeline-info = custom_icon("icon_commit")
.icon-container = link_to commit.short_id, project_commit_path(@project, @pipeline.sha), class: "commit-sha js-details-short"
= icon('clock-o') = link_to("#", class: "js-details-expand d-none d-sm-none d-md-inline") do
= pluralize @pipeline.total_size, "job" %span.text-expander
- if @pipeline.ref = sprite_icon('ellipsis_h', size: 12)
from %span.js-details-content.hide
= link_to @pipeline.ref, project_ref_path(@project, @pipeline.ref), class: "ref-name" = link_to @pipeline.sha, project_commit_path(@project, @pipeline.sha), class: "commit-sha commit-hash-full"
- if @pipeline.duration = clipboard_button(text: @pipeline.sha, title: "Copy commit SHA to clipboard")
in
= time_interval_in_words(@pipeline.duration)
- if @pipeline.queued_duration
= "(queued for #{time_interval_in_words(@pipeline.queued_duration)})"
.well-segment.branch-info = render_if_exists "projects/pipelines/info_extension", pipeline: @pipeline
.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("#", class: "js-details-expand d-none d-sm-none d-md-inline") do
%span.text-expander
= sprite_icon('ellipsis_h', size: 12)
%span.js-details-content.hide
= link_to @pipeline.sha, project_commit_path(@project, @pipeline.sha), class: "commit-sha commit-hash-full"
= clipboard_button(text: @pipeline.sha, title: "Copy commit SHA to clipboard")
= render_if_exists "projects/pipelines/info_extension", pipeline: @pipeline
...@@ -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