Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
4c0adb9e
Commit
4c0adb9e
authored
Apr 16, 2017
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build failures summary page for pipelines
parent
992aafbc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
106 additions
and
8 deletions
+106
-8
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+1
-0
app/assets/stylesheets/pages/pipelines.scss
app/assets/stylesheets/pages/pipelines.scss
+26
-0
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+14
-6
app/helpers/builds_helper.rb
app/helpers/builds_helper.rb
+8
-0
app/views/projects/pipelines/_with_tabs.html.haml
app/views/projects/pipelines/_with_tabs.html.haml
+14
-2
changelogs/unreleased/24883-build-failure-summary-page.yml
changelogs/unreleased/24883-build-failure-summary-page.yml
+4
-0
config/routes/project.rb
config/routes/project.rb
+1
-0
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+38
-0
No files found.
app/assets/javascripts/dispatcher.js
View file @
4c0adb9e
...
@@ -232,6 +232,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
...
@@ -232,6 +232,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
}
}
break
;
break
;
case
'
projects:pipelines:builds
'
:
case
'
projects:pipelines:builds
'
:
case
'
projects:pipelines:failures
'
:
case
'
projects:pipelines:show
'
:
case
'
projects:pipelines:show
'
:
const
{
controllerAction
}
=
document
.
querySelector
(
'
.js-pipeline-container
'
).
dataset
;
const
{
controllerAction
}
=
document
.
querySelector
(
'
.js-pipeline-container
'
).
dataset
;
const
pipelineStatusUrl
=
`
${
document
.
querySelector
(
'
.js-pipeline-tab-link a
'
).
getAttribute
(
'
href
'
)}
/status.json`
;
const
pipelineStatusUrl
=
`
${
document
.
querySelector
(
'
.js-pipeline-tab-link a
'
).
getAttribute
(
'
href
'
)}
/status.json`
;
...
...
app/assets/stylesheets/pages/pipelines.scss
View file @
4c0adb9e
...
@@ -316,6 +316,32 @@
...
@@ -316,6 +316,32 @@
}
}
}
}
.build-failures
{
.build-state
{
padding
:
20px
2px
;
.build-name
{
float
:
right
;
font-weight
:
500
;
}
.ci-status-icon-failed
svg
{
vertical-align
:
middle
;
}
.stage
{
color
:
$gl-text-color-secondary
;
font-weight
:
500
;
vertical-align
:
middle
;
}
}
.build-log
{
border
:
none
;
line-height
:
initial
;
}
}
// Pipeline graph
// Pipeline graph
.pipeline-graph
{
.pipeline-graph
{
width
:
100%
;
width
:
100%
;
...
...
app/controllers/projects/pipelines_controller.rb
View file @
4c0adb9e
class
Projects::PipelinesController
<
Projects
::
ApplicationController
class
Projects::PipelinesController
<
Projects
::
ApplicationController
before_action
:pipeline
,
except:
[
:index
,
:new
,
:create
,
:charts
]
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_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
]
...
@@ -67,11 +67,11 @@ class Projects::PipelinesController < Projects::ApplicationController
...
@@ -67,11 +67,11 @@ class Projects::PipelinesController < Projects::ApplicationController
end
end
def
builds
def
builds
re
spond_to
do
|
format
|
re
nder_show
format
.
html
do
end
render
'show'
end
def
failures
end
render_show
end
end
def
status
def
status
...
@@ -111,6 +111,14 @@ class Projects::PipelinesController < Projects::ApplicationController
...
@@ -111,6 +111,14 @@ class Projects::PipelinesController < Projects::ApplicationController
private
private
def
render_show
respond_to
do
|
format
|
format
.
html
do
render
'show'
end
end
end
def
create_params
def
create_params
params
.
require
(
:pipeline
).
permit
(
:ref
)
params
.
require
(
:pipeline
).
permit
(
:ref
)
end
end
...
...
app/helpers/builds_helper.rb
View file @
4c0adb9e
module
BuildsHelper
module
BuildsHelper
def
build_summary
(
build
)
if
build
.
has_trace?
build
.
trace
.
html
(
last_lines:
10
).
html_safe
else
"No job trace"
end
end
def
sidebar_build_class
(
build
,
current_build
)
def
sidebar_build_class
(
build
,
current_build
)
build_class
=
''
build_class
=
''
build_class
+=
' active'
if
build
.
id
===
current_build
.
id
build_class
+=
' active'
if
build
.
id
===
current_build
.
id
...
...
app/views/projects/pipelines/_with_tabs.html.haml
View file @
4c0adb9e
...
@@ -7,8 +7,10 @@
...
@@ -7,8 +7,10 @@
=
link_to
builds_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-builds'
,
action:
'builds'
,
toggle:
'tab'
},
class:
'builds-tab'
do
=
link_to
builds_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-builds'
,
action:
'builds'
,
toggle:
'tab'
},
class:
'builds-tab'
do
Jobs
Jobs
%span
.badge.js-builds-counter
=
pipeline
.
statuses
.
count
%span
.badge.js-builds-counter
=
pipeline
.
statuses
.
count
%li
.js-failures-tab-link
=
link_to
failures_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-failures'
,
action:
'failures'
,
toggle:
'tab'
},
class:
'failures-tab'
do
Failures
%span
.badge.js-failures-counter
=
pipeline
.
statuses
.
latest
.
failed
.
count
.tab-content
.tab-content
#js-tab-pipeline
.tab-pane
#js-tab-pipeline
.tab-pane
...
@@ -39,3 +41,13 @@
...
@@ -39,3 +41,13 @@
%th
Coverage
%th
Coverage
%th
%th
=
render
partial:
"projects/stage/stage"
,
collection:
pipeline
.
stages
,
as: :stage
=
render
partial:
"projects/stage/stage"
,
collection:
pipeline
.
stages
,
as: :stage
#js-tab-failures
.build-failures.tab-pane
-
failed
=
@pipeline
.
statuses
.
latest
.
failed
-
failed
.
each
do
|
build
|
.build-state
%span
.ci-status-icon-failed
=
custom_icon
(
'icon_status_failed'
)
%span
.stage
=
build
.
stage
.
titleize
%span
.build-name
=
render
"notify/links/
#{
build
.
to_partial_path
}
"
,
pipeline:
@pipeline
,
build:
build
%pre
.build-log
=
build_summary
(
build
)
changelogs/unreleased/24883-build-failure-summary-page.yml
0 → 100644
View file @
4c0adb9e
---
title
:
Added build failures summary page for pipelines
merge_request
:
10719
author
:
config/routes/project.rb
View file @
4c0adb9e
...
@@ -155,6 +155,7 @@ constraints(ProjectUrlConstrainer.new) do
...
@@ -155,6 +155,7 @@ constraints(ProjectUrlConstrainer.new) do
post
:cancel
post
:cancel
post
:retry
post
:retry
get
:builds
get
:builds
get
:failures
get
:status
get
:status
end
end
end
end
...
...
spec/features/projects/pipelines/pipeline_spec.rb
View file @
4c0adb9e
...
@@ -254,4 +254,42 @@ describe 'Pipeline', :feature, :js do
...
@@ -254,4 +254,42 @@ describe 'Pipeline', :feature, :js do
it
{
expect
(
build_manual
.
reload
).
to
be_pending
}
it
{
expect
(
build_manual
.
reload
).
to
be_pending
}
end
end
end
end
describe
'GET /:project/pipelines/:id/failures'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'master'
,
sha:
project
.
commit
.
id
)
}
let
(
:pipeline_failures_page
)
{
failures_namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
}
let!
(
:failed_build
)
{
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
)
}
context
'with failed build'
do
before
do
failed_build
.
trace
.
set
(
'4 examples, 1 failure'
)
visit
pipeline_failures_page
end
it
'shows jobs tab pane as active'
do
expect
(
page
).
to
have_css
(
'#js-tab-failures.active'
)
end
it
'lists failed builds'
do
expect
(
page
).
to
have_content
(
failed_build
.
name
)
expect
(
page
).
to
have_content
(
failed_build
.
stage
)
end
it
'shows build failure logs'
do
expect
(
page
).
to
have_content
(
'4 examples, 1 failure'
)
end
end
context
'when missing build logs'
do
before
do
visit
pipeline_failures_page
end
it
'includes failed jobs'
do
expect
(
page
).
to
have_content
(
'No job trace'
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment