summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-08-17 16:49:42 +0000
committerRuben Davila <rdavila84@gmail.com>2016-08-17 15:10:37 -0500
commiteaf8ae2eddec233374693d67d3d3c9c75d180763 (patch)
tree28de35454bf317167bbcd58f9da932b8f74dfd6a /app/controllers
parent58e25cb349bd1f20ee7cff410f59501ef3ed3616 (diff)
downloadgitlab-ce-eaf8ae2eddec233374693d67d3d3c9c75d180763.tar.gz
Merge branch '18681-pipelines-merge-request' into 'master'
Resolve "Pipelines for merge request" ## What does this MR do? Adds `Pipelines` tab in merge request view ## What are the relevant issue numbers? Closes #18681 ## Screenshots (if relevant) ![Screen_Shot_2016-08-16_at_3.22.41_PM](/uploads/c04febab3765b1fac2bf3bbfb9882f9f/Screen_Shot_2016-08-16_at_3.22.41_PM.png) See merge request !5485
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/merge_requests_controller.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 7ca2dd2276a..7f331ba1dcd 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -9,15 +9,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_action :module_enabled
before_action :merge_request, only: [
- :edit, :update, :show, :diffs, :commits, :builds, :merge, :merge_check,
+ :edit, :update, :show, :diffs, :commits, :builds, :pipelines, :merge, :merge_check,
:ci_status, :toggle_subscription, :cancel_merge_when_build_succeeds, :remove_wip
]
- before_action :validates_merge_request, only: [:show, :diffs, :commits, :builds]
- before_action :define_show_vars, only: [:show, :diffs, :commits, :builds]
+ before_action :validates_merge_request, only: [:show, :diffs, :commits, :builds, :pipelines]
+ before_action :define_show_vars, only: [:show, :diffs, :commits, :builds, :pipelines]
before_action :define_widget_vars, only: [:merge, :cancel_merge_when_build_succeeds, :merge_check]
before_action :define_commit_vars, only: [:diffs]
before_action :define_diff_comment_vars, only: [:diffs]
- before_action :ensure_ref_fetched, only: [:show, :diffs, :commits, :builds]
+ before_action :ensure_ref_fetched, only: [:show, :diffs, :commits, :builds, :pipelines]
# Allow read any merge_request
before_action :authorize_read_merge_request!
@@ -141,6 +141,19 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
end
+ def pipelines
+ @pipelines = @merge_request.all_pipelines
+
+ respond_to do |format|
+ format.html do
+ define_discussion_vars
+
+ render 'show'
+ end
+ format.json { render json: { html: view_to_html_string('projects/merge_requests/show/_pipelines') } }
+ end
+ end
+
def new
apply_diff_view_cookie!