BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
48 deletions
+65
-48
CHANGELOG
CHANGELOG
+1
-0
ci.html.haml
app/views/projects/graphs/ci.html.haml
+11
-5
_build_times.haml
app/views/projects/graphs/ci/_build_times.haml
+9
-8
_builds.haml
app/views/projects/graphs/ci/_builds.haml
+30
-20
_overall.haml
app/views/projects/graphs/ci/_overall.haml
+7
-9
commits.html.haml
app/views/projects/graphs/commits.html.haml
+1
-1
show.html.haml
app/views/projects/graphs/show.html.haml
+1
-1
graph.rb
features/steps/project/graph.rb
+3
-3
charts.rb
lib/ci/charts.rb
+2
-1
No files found.
CHANGELOG
View file @
9b5d2753
...
@@ -28,6 +28,7 @@ v 8.2.0 (unreleased)
...
@@ -28,6 +28,7 @@ v 8.2.0 (unreleased)
- New design for project graphs page
- New design for project graphs page
- Fix incoming email config defaults
- Fix incoming email config defaults
- MR target branch is now visible on a list view when it is different from project's default one
- 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
v 8.1.4
- Fix bug where manually merged branches in a MR would end up with an empty diff (Stan Hu)
- 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"
-
page_title
"Continuous Integration"
,
"Graphs"
=
render
"header_title"
=
render
"header_title"
=
render
'head'
=
render
'head'
.gray-content-block
.gray-content-block.append-bottom-default
%ul
.breadcrumb.repo-breadcrumb
.oneline
=
commits_breadcrumbs
A collection of graphs for Continuous Integration
#charts
.ci-charts
#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/builds'
=
render
'projects/graphs/ci/build_times'
=
render
'projects/graphs/ci/overall'
app/views/projects/graphs/ci/_build_times.haml
View file @
9b5d2753
%
fieldset
%
div
%
legend
%
p
.light
Commit duration in minutes for last 30 commits
Commit duration in minutes for last 30 commits
%canvas
#build_timesChart
.padded
{
width:
800
,
height:
3
00
}
%canvas
#build_timesChart
{
height:
2
00
}
:javascript
:javascript
var
data
=
{
var
data
=
{
labels
:
#{
@charts
[
:build_times
].
labels
.
to_json
}
,
labels
:
#{
@charts
[
:build_times
].
labels
.
to_json
}
,
datasets
:
[
datasets
:
[
{
{
fillColor
:
"#4A3"
,
fillColor
:
"rgba(220,220,220,0.5)"
,
strokeColor
:
"rgba(151,187,205,1)"
,
strokeColor
:
"rgba(220,220,220,1)"
,
pointColor
:
"rgba(151,187,205,1)"
,
barStrokeWidth
:
1
,
pointStrokeColor
:
"#fff"
,
barValueSpacing
:
1
,
barDatasetSpacing
:
1
,
data
:
#{
@charts
[
:build_times
].
build_times
.
to_json
}
data
:
#{
@charts
[
:build_times
].
build_times
.
to_json
}
}
}
]
]
}
}
var
ctx
=
$
(
"#build_timesChart"
).
get
(
0
).
getContext
(
"2d"
);
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
%h4
Build charts
%legend
%p
Builds chart for last week
(
#{
date_from_to
(
Date
.
today
-
7
.
days
,
Date
.
today
)
}
)
%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
.prepend-top-defaul
t
%
legend
%
p
.light
Builds
chart
for last month
Builds for last month
(
#{
date_from_to
(
Date
.
today
-
30
.
days
,
Date
.
today
)
}
)
(
#{
date_from_to
(
Date
.
today
-
30
.
days
,
Date
.
today
)
}
)
%canvas
#monthChart
{
height:
200
}
%canvas
#monthChart
.padded
{
width:
800
,
height:
300
}
.prepend-top-default
%p
.light
%fieldset
Builds for last year
%legend
Builds chart for last year
%canvas
#yearChart
.padded
{
height:
250
}
%canvas
#yearChart
.padded
{
width:
800
,
height:
400
}
-
[
:week
,
:month
,
:year
].
each
do
|
scope
|
-
[
:week
,
:month
,
:year
].
each
do
|
scope
|
:javascript
:javascript
...
@@ -22,20 +32,20 @@
...
@@ -22,20 +32,20 @@
labels
:
#{
@charts
[
scope
].
labels
.
to_json
}
,
labels
:
#{
@charts
[
scope
].
labels
.
to_json
}
,
datasets
:
[
datasets
:
[
{
{
fillColor
:
"
rgba(220,220,220,0.5)
"
,
fillColor
:
"
#7f8fa4
"
,
strokeColor
:
"
rgba(220,220,220,1)
"
,
strokeColor
:
"
#7f8fa4
"
,
pointColor
:
"
rgba(220,220,220,1)
"
,
pointColor
:
"
#7f8fa4
"
,
pointStrokeColor
:
"#EEE"
,
pointStrokeColor
:
"#EEE"
,
data
:
#{
@charts
[
scope
].
total
.
to_json
}
data
:
#{
@charts
[
scope
].
total
.
to_json
}
},
},
{
{
fillColor
:
"#4
A3
"
,
fillColor
:
"#4
4aa22
"
,
strokeColor
:
"
rgba(151,187,205,1)
"
,
strokeColor
:
"
#44aa22
"
,
pointColor
:
"
rgba(151,187,205,1)
"
,
pointColor
:
"
#44aa22
"
,
pointStrokeColor
:
"#fff"
,
pointStrokeColor
:
"#fff"
,
data
:
#{
@charts
[
scope
].
success
.
to_json
}
data
:
#{
@charts
[
scope
].
success
.
to_json
}
}
}
]
]
}
}
var
ctx
=
$
(
"##{scope}Chart"
).
get
(
0
).
getContext
(
"2d"
);
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
-
ci_project
=
@project
.
gitlab_ci_project
%
fieldset
%
h4
Overall stats
%legend
Overal
l
%u
l
%
p
%
li
Total:
Total:
%strong
=
pluralize
ci_project
.
builds
.
count
(
:all
),
'build'
%strong
=
pluralize
ci_project
.
builds
.
count
(
:all
),
'build'
%
p
%
li
Successful:
Successful:
%strong
=
pluralize
ci_project
.
builds
.
success
.
count
(
:all
),
'build'
%strong
=
pluralize
ci_project
.
builds
.
success
.
count
(
:all
),
'build'
%
p
%
li
Failed:
Failed:
%strong
=
pluralize
ci_project
.
builds
.
failed
.
count
(
:all
),
'build'
%strong
=
pluralize
ci_project
.
builds
.
failed
.
count
(
:all
),
'build'
%li
%p
Success ratio:
Success ratio:
%strong
%strong
#{
success_ratio
(
ci_project
.
builds
.
success
,
ci_project
.
builds
.
failed
)
}
%
#{
success_ratio
(
ci_project
.
builds
.
success
,
ci_project
.
builds
.
failed
)
}
%
%li
%p
Commits covered:
Commits covered:
%strong
%strong
=
ci_project
.
commits
.
count
(
:all
)
=
ci_project
.
commits
.
count
(
:all
)
app/views/projects/graphs/commits.html.haml
View file @
9b5d2753
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
=
render
"header_title"
=
render
"header_title"
=
render
'head'
=
render
'head'
.gray-content-block
.gray-content-block
.append-bottom-default
.tree-ref-holder
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'graphs_commits'
=
render
'shared/ref_switcher'
,
destination:
'graphs_commits'
%ul
.breadcrumb.repo-breadcrumb
%ul
.breadcrumb.repo-breadcrumb
...
...
app/views/projects/graphs/show.html.haml
View file @
9b5d2753
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
=
render
"header_title"
=
render
"header_title"
=
render
'head'
=
render
'head'
.gray-content-block
.gray-content-block
.append-bottom-default
.tree-ref-holder
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'graphs'
=
render
'shared/ref_switcher'
,
destination:
'graphs'
%ul
.breadcrumb.repo-breadcrumb
%ul
.breadcrumb.repo-breadcrumb
...
...
features/steps/project/graph.rb
View file @
9b5d2753
...
@@ -25,9 +25,9 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
...
@@ -25,9 +25,9 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
step
'page should have CI graphs'
do
step
'page should have CI graphs'
do
expect
(
page
).
to
have_content
'Overall'
expect
(
page
).
to
have_content
'Overall'
expect
(
page
).
to
have_content
'Builds
chart
for last week'
expect
(
page
).
to
have_content
'Builds for last week'
expect
(
page
).
to
have_content
'Builds
chart
for last month'
expect
(
page
).
to
have_content
'Builds for last month'
expect
(
page
).
to
have_content
'Builds
chart
for last year'
expect
(
page
).
to
have_content
'Builds for last year'
expect
(
page
).
to
have_content
'Commit duration in minutes for last 30 commits'
expect
(
page
).
to
have_content
'Commit duration in minutes for last 30 commits'
end
end
...
...
lib/ci/charts.rb
View file @
9b5d2753
...
@@ -60,7 +60,8 @@ module Ci
...
@@ -60,7 +60,8 @@ module Ci
class
BuildTime
<
Chart
class
BuildTime
<
Chart
def
collect
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
|
commits
.
each
do
|
commit
|
@labels
<<
commit
.
short_sha
@labels
<<
commit
.
short_sha
@build_times
<<
(
commit
.
duration
/
60
)
@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