Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-05-05 21:58:01 +0300
committerPhil Hughes <me@iamphill.com>2017-05-05 21:58:01 +0300
commit9caa7e7a54a5e3d261f77765868b07117a282a68 (patch)
treeca3c6b9de47499fde1f02aa39edef00deaafcaaa /app/controllers/projects/pipelines_controller.rb
parent240400152242924e75ea81918b5cfdcf2441549c (diff)
parent9f3f22c8959b430811102fb790895e7edd61d3f9 (diff)
Merge branch '24883-build-failure-summary-page' into 'master'
Build failures summary page for pipelines Closes #24883 See merge request !10719
Diffstat (limited to 'app/controllers/projects/pipelines_controller.rb')
-rw-r--r--app/controllers/projects/pipelines_controller.rb22
1 files changed, 17 insertions, 5 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 2908036607a..f9adedcb074 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -1,6 +1,6 @@
class Projects::PipelinesController < Projects::ApplicationController
before_action :pipeline, except: [:index, :new, :create, :charts]
- before_action :commit, only: [:show, :builds]
+ 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]
@@ -69,10 +69,14 @@ class Projects::PipelinesController < Projects::ApplicationController
end
def builds
- respond_to do |format|
- format.html do
- render 'show'
- end
+ render_show
+ end
+
+ def failures
+ if @pipeline.statuses.latest.failed.present?
+ render_show
+ else
+ redirect_to pipeline_path(@pipeline)
end
end
@@ -125,6 +129,14 @@ class Projects::PipelinesController < Projects::ApplicationController
private
+ def render_show
+ respond_to do |format|
+ format.html do
+ render 'show'
+ end
+ end
+ end
+
def create_params
params.require(:pipeline).permit(:ref)
end