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
9b5d2753
Commit
9b5d2753
authored
Nov 10, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'improve-ci-graphs'
parents
8ecc6f94
802b8fce
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
48 deletions
+65
-48
CHANGELOG
CHANGELOG
+1
-0
app/views/projects/graphs/ci.html.haml
app/views/projects/graphs/ci.html.haml
+11
-5
app/views/projects/graphs/ci/_build_times.haml
app/views/projects/graphs/ci/_build_times.haml
+9
-8
app/views/projects/graphs/ci/_builds.haml
app/views/projects/graphs/ci/_builds.haml
+30
-20
app/views/projects/graphs/ci/_overall.haml
app/views/projects/graphs/ci/_overall.haml
+7
-9
app/views/projects/graphs/commits.html.haml
app/views/projects/graphs/commits.html.haml
+1
-1
app/views/projects/graphs/show.html.haml
app/views/projects/graphs/show.html.haml
+1
-1
features/steps/project/graph.rb
features/steps/project/graph.rb
+3
-3
lib/ci/charts.rb
lib/ci/charts.rb
+2
-1
No files found.
CHANGELOG
View file @
9b5d2753
...
...
@@ -28,6 +28,7 @@ v 8.2.0 (unreleased)
- New design for project graphs page
- Fix incoming email config defaults
- MR target branch is now visible on a list view when it is different from project's default one
- Improve Continuous Integration graphs page
v 8.1.4
- Fix bug where manually merged branches in a MR would end up with an empty diff (Stan Hu)
...
...
app/views/projects/graphs/ci.html.haml
View file @
9b5d2753
-
page_title
"Continuous Integration"
,
"Graphs"
=
render
"header_title"
=
render
'head'
.gray-content-block
%ul
.breadcrumb.repo-breadcrumb
=
commits_breadcrumbs
.gray-content-block.append-bottom-default
.oneline
A collection of graphs for Continuous Integration
#charts
.ci-charts
.row
.col-md-6
=
render
'projects/graphs/ci/overall'
.col-md-6
=
render
'projects/graphs/ci/build_times'
%hr
=
render
'projects/graphs/ci/builds'
=
render
'projects/graphs/ci/build_times'
=
render
'projects/graphs/ci/overall'
app/views/projects/graphs/ci/_build_times.haml
View file @
9b5d2753
%
fieldset
%
legend
%
div
%
p
.light
Commit duration in minutes for last 30 commits
%canvas
#build_timesChart
.padded
{
width:
800
,
height:
3
00
}
%canvas
#build_timesChart
{
height:
2
00
}
:javascript
var
data
=
{
labels
:
#{
@charts
[
:build_times
].
labels
.
to_json
}
,
datasets
:
[
{
fillColor
:
"
#4A3
"
,
strokeColor
:
"
rgba(151,187,205,1)
"
,
pointColor
:
"
rgba(151,187,205,1)
"
,
pointStrokeColor
:
"
#fff
"
,
fillColor
:
"
rgba(220,220,220,0.5)
"
,
strokeColor
:
"
rgba(220,220,220,1)
"
,
barStrokeWidth
:
1
,
barValueSpacing
:
1
,
barDatasetSpacing
:
1
,
data
:
#{
@charts
[
:build_times
].
build_times
.
to_json
}
}
]
}
var
ctx
=
$
(
"
#build_timesChart
"
).
get
(
0
).
getContext
(
"
2d
"
);
new
Chart
(
ctx
).
Line
(
data
,{
"
scaleOverlay
"
:
tru
e
});
new
Chart
(
ctx
).
Bar
(
data
,{
"
scaleOverlay
"
:
true
,
responsive
:
true
,
maintainAspectRatio
:
fals
e
});
app/views/projects/graphs/ci/_builds.haml
View file @
9b5d2753
%fieldset
%legend
Builds chart for last week
(
#{
date_from_to
(
Date
.
today
-
7
.
days
,
Date
.
today
)
}
)
%h4
Build charts
%p
%span
.cgreen
=
icon
(
"circle"
)
success
%span
.cgray
=
icon
(
"circle"
)
all
%canvas
#weekChart
.padded
{
width:
800
,
height:
200
}
.prepend-top-default
%p
.light
Builds for last week
(
#{
date_from_to
(
Date
.
today
-
7
.
days
,
Date
.
today
)
}
)
%canvas
#weekChart
{
height:
200
}
%fieldse
t
%
legend
Builds
chart
for last month
.prepend-top-defaul
t
%
p
.light
Builds for last month
(
#{
date_from_to
(
Date
.
today
-
30
.
days
,
Date
.
today
)
}
)
%canvas
#monthChart
{
height:
200
}
%canvas
#monthChart
.padded
{
width:
800
,
height:
300
}
%fieldset
%legend
Builds chart for last year
%canvas
#yearChart
.padded
{
width:
800
,
height:
400
}
.prepend-top-default
%p
.light
Builds for last year
%canvas
#yearChart
.padded
{
height:
250
}
-
[
:week
,
:month
,
:year
].
each
do
|
scope
|
:javascript
...
...
@@ -22,20 +32,20 @@
labels
:
#{
@charts
[
scope
].
labels
.
to_json
}
,
datasets
:
[
{
fillColor
:
"
rgba(220,220,220,0.5)
"
,
strokeColor
:
"
rgba(220,220,220,1)
"
,
pointColor
:
"
rgba(220,220,220,1)
"
,
fillColor
:
"
#7f8fa4
"
,
strokeColor
:
"
#7f8fa4
"
,
pointColor
:
"
#7f8fa4
"
,
pointStrokeColor
:
"
#EEE
"
,
data
:
#{
@charts
[
scope
].
total
.
to_json
}
},
{
fillColor
:
"
#4
A3
"
,
strokeColor
:
"
rgba(151,187,205,1)
"
,
pointColor
:
"
rgba(151,187,205,1)
"
,
fillColor
:
"
#4
4aa22
"
,
strokeColor
:
"
#44aa22
"
,
pointColor
:
"
#44aa22
"
,
pointStrokeColor
:
"
#fff
"
,
data
:
#{
@charts
[
scope
].
success
.
to_json
}
}
]
}
var
ctx
=
$
(
"
##{scope}Chart
"
).
get
(
0
).
getContext
(
"
2d
"
);
new
Chart
(
ctx
).
Line
(
data
,{
"
scaleOverlay
"
:
true
});
new
Chart
(
ctx
).
Line
(
data
,{
"
scaleOverlay
"
:
true
,
responsive
:
true
,
maintainAspectRatio
:
false
});
app/views/projects/graphs/ci/_overall.haml
View file @
9b5d2753
-
ci_project
=
@project
.
gitlab_ci_project
%
fieldset
%legend
Overal
l
%
p
%
h4
Overall stats
%u
l
%
li
Total:
%strong
=
pluralize
ci_project
.
builds
.
count
(
:all
),
'build'
%
p
%
li
Successful:
%strong
=
pluralize
ci_project
.
builds
.
success
.
count
(
:all
),
'build'
%
p
%
li
Failed:
%strong
=
pluralize
ci_project
.
builds
.
failed
.
count
(
:all
),
'build'
%p
%li
Success ratio:
%strong
#{
success_ratio
(
ci_project
.
builds
.
success
,
ci_project
.
builds
.
failed
)
}
%
%p
%li
Commits covered:
%strong
=
ci_project
.
commits
.
count
(
:all
)
app/views/projects/graphs/commits.html.haml
View file @
9b5d2753
...
...
@@ -2,7 +2,7 @@
=
render
"header_title"
=
render
'head'
.gray-content-block
.gray-content-block
.append-bottom-default
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'graphs_commits'
%ul
.breadcrumb.repo-breadcrumb
...
...
app/views/projects/graphs/show.html.haml
View file @
9b5d2753
...
...
@@ -2,7 +2,7 @@
=
render
"header_title"
=
render
'head'
.gray-content-block
.gray-content-block
.append-bottom-default
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'graphs'
%ul
.breadcrumb.repo-breadcrumb
...
...
features/steps/project/graph.rb
View file @
9b5d2753
...
...
@@ -25,9 +25,9 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
step
'page should have CI graphs'
do
expect
(
page
).
to
have_content
'Overall'
expect
(
page
).
to
have_content
'Builds
chart
for last week'
expect
(
page
).
to
have_content
'Builds
chart
for last month'
expect
(
page
).
to
have_content
'Builds
chart
for last year'
expect
(
page
).
to
have_content
'Builds for last week'
expect
(
page
).
to
have_content
'Builds for last month'
expect
(
page
).
to
have_content
'Builds for last year'
expect
(
page
).
to
have_content
'Commit duration in minutes for last 30 commits'
end
...
...
lib/ci/charts.rb
View file @
9b5d2753
...
...
@@ -60,7 +60,8 @@ module Ci
class
BuildTime
<
Chart
def
collect
commits
=
project
.
commits
.
joins
(
:builds
).
where
(
"
#{
Ci
::
Build
.
table_name
}
.finished_at is NOT NULL AND
#{
Ci
::
Build
.
table_name
}
.started_at is NOT NULL"
).
last
(
30
)
commits
=
project
.
commits
.
last
(
30
)
commits
.
each
do
|
commit
|
@labels
<<
commit
.
short_sha
@build_times
<<
(
commit
.
duration
/
60
)
...
...
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