summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-08-02 17:15:11 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-08-02 17:15:11 +0000
commit367e7520b08b1b731d5298fe700fc39f356017ce (patch)
treec9637a30c3bacc4fe3808fb583eaf16b941ca158
parentf5b9e2879090d86c41ee6ec2b9e6e14d7cd3fd59 (diff)
parent14e88565c68de056c83ddc53a68ade4c3f82b531 (diff)
downloadgitlab-ce-367e7520b08b1b731d5298fe700fc39f356017ce.tar.gz
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
-rw-r--r--app/controllers/projects/pipelines_controller.rb5
-rw-r--r--app/views/projects/pipelines/_info.html.haml65
-rw-r--r--app/views/projects/pipelines/show.html.haml6
3 files changed, 35 insertions, 41 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 1d5d1ee5d5a..b5db646bf57 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -1,7 +1,6 @@
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')
diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml
index bc247460d28..78e3b209686 100644
--- a/app/views/projects/pipelines/_info.html.haml
+++ b/app/views/projects/pipelines/_info.html.haml
@@ -1,37 +1,34 @@
-#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?
- .commit-box
- %h3.commit-title
- = markdown(@commit.title, pipeline: :single_line)
- - if @commit.description.present?
- .commit-description<
- = preserve(markdown(@commit.description, pipeline: :single_line))
+.info-well
+ - if commit.status
+ .well-segment.pipeline-info
+ .icon-container
+ = icon('clock-o')
+ = pluralize @pipeline.total_size, "job"
+ - 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
- - if @commit.status
- .well-segment.pipeline-info
- .icon-container
- = icon('clock-o')
- = pluralize @pipeline.total_size, "job"
- - 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)})"
+ .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("#", 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")
- .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("#", 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
+ = render_if_exists "projects/pipelines/info_extension", pipeline: @pipeline
diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml
index a7d7c923957..ff0ed3ed30d 100644
--- a/app/views/projects/pipelines/show.html.haml
+++ b/app/views/projects/pipelines/show.html.haml
@@ -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