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
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
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
app/models/cycle_analytics.rb
app/models/cycle_analytics.rb
+3
-1
lib/gitlab/cycle_analytics/stage_summary.rb
lib/gitlab/cycle_analytics/stage_summary.rb
+3
-2
lib/gitlab/cycle_analytics/summary/issue.rb
lib/gitlab/cycle_analytics/summary/issue.rb
+7
-1
spec/lib/gitlab/cycle_analytics/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
end
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
def
stats
...
...
lib/gitlab/cycle_analytics/stage_summary.rb
View file @
58dddcdf
module
Gitlab
module
CycleAnalytics
class
StageSummary
def
initialize
(
project
,
from
:)
def
initialize
(
project
,
from
:
,
current_user
:
)
@project
=
project
@from
=
from
@current_user
=
current_user
end
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
::
Deploy
.
new
(
project:
@project
,
from:
@from
))]
end
...
...
lib/gitlab/cycle_analytics/summary/issue.rb
View file @
58dddcdf
...
...
@@ -2,12 +2,18 @@ module Gitlab
module
CycleAnalytics
module
Summary
class
Issue
<
Base
def
initialize
(
project
:,
from
:,
current_user
:)
@project
=
project
@from
=
from
@current_user
=
current_user
end
def
title
'New Issue'
end
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
...
...
spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb
View file @
58dddcdf
...
...
@@ -2,9 +2,9 @@ require 'spec_helper'
describe
Gitlab
::
CycleAnalytics
::
StageSummary
,
models:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:from
)
{
Time
.
now
}
let
(
:from
)
{
1
.
day
.
ago
}
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
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