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
58dddcdf
Commit
58dddcdf
authored
Dec 01, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
few fixes after merge
parent
69ecd951
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
cycle_analytics.rb
app/models/cycle_analytics.rb
+3
-1
stage_summary.rb
lib/gitlab/cycle_analytics/stage_summary.rb
+3
-2
issue.rb
lib/gitlab/cycle_analytics/summary/issue.rb
+7
-1
stage_summary_spec.rb
spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb
+2
-2
No files found.
app/models/cycle_analytics.rb
View file @
58dddcdf
...
@@ -7,7 +7,9 @@ class CycleAnalytics
...
@@ -7,7 +7,9 @@ class CycleAnalytics
end
end
def
summary
def
summary
@summary
||=
::
Gitlab
::
CycleAnalytics
::
StageSummary
.
new
(
@project
,
from:
@options
[
:from
]).
data
@summary
||=
::
Gitlab
::
CycleAnalytics
::
StageSummary
.
new
(
@project
,
from:
@options
[
:from
],
current_user:
@options
[
:current_user
]).
data
end
end
def
stats
def
stats
...
...
lib/gitlab/cycle_analytics/stage_summary.rb
View file @
58dddcdf
module
Gitlab
module
Gitlab
module
CycleAnalytics
module
CycleAnalytics
class
StageSummary
class
StageSummary
def
initialize
(
project
,
from
:)
def
initialize
(
project
,
from
:
,
current_user
:
)
@project
=
project
@project
=
project
@from
=
from
@from
=
from
@current_user
=
current_user
end
end
def
data
def
data
[
serialize
(
Summary
::
Issue
.
new
(
project:
@project
,
from:
@from
)),
[
serialize
(
Summary
::
Issue
.
new
(
project:
@project
,
from:
@from
,
current_user:
@current_user
)),
serialize
(
Summary
::
Commit
.
new
(
project:
@project
,
from:
@from
)),
serialize
(
Summary
::
Commit
.
new
(
project:
@project
,
from:
@from
)),
serialize
(
Summary
::
Deploy
.
new
(
project:
@project
,
from:
@from
))]
serialize
(
Summary
::
Deploy
.
new
(
project:
@project
,
from:
@from
))]
end
end
...
...
lib/gitlab/cycle_analytics/summary/issue.rb
View file @
58dddcdf
...
@@ -2,12 +2,18 @@ module Gitlab
...
@@ -2,12 +2,18 @@ module Gitlab
module
CycleAnalytics
module
CycleAnalytics
module
Summary
module
Summary
class
Issue
<
Base
class
Issue
<
Base
def
initialize
(
project
:,
from
:,
current_user
:)
@project
=
project
@from
=
from
@current_user
=
current_user
end
def
title
def
title
'New Issue'
'New Issue'
end
end
def
value
def
value
@value
||=
@project
.
issues
.
created_after
(
@from
).
count
@value
||=
IssuesFinder
.
new
(
@current_user
,
project_id:
@project
.
id
).
execute
.
created_after
(
@from
).
count
end
end
end
end
end
end
...
...
spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb
View file @
58dddcdf
...
@@ -2,9 +2,9 @@ require 'spec_helper'
...
@@ -2,9 +2,9 @@ require 'spec_helper'
describe
Gitlab
::
CycleAnalytics
::
StageSummary
,
models:
true
do
describe
Gitlab
::
CycleAnalytics
::
StageSummary
,
models:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:from
)
{
Time
.
now
}
let
(
:from
)
{
1
.
day
.
ago
}
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:user
)
{
create
(
:user
,
:admin
)
}
subject
{
described_class
.
new
(
project
,
from:
Time
.
now
).
data
}
subject
{
described_class
.
new
(
project
,
from:
Time
.
now
,
current_user:
user
).
data
}
describe
"#new_issues"
do
describe
"#new_issues"
do
it
"finds the number of issues created after the 'from date'"
do
it
"finds the number of issues created after the 'from date'"
do
...
...
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