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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
326d2782
Commit
326d2782
authored
Jul 09, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix passing filter params to VSA time summary
This MR fixes a bug where the issuable filter params were ignored.
parent
6ac20f41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
ee/changelogs/unreleased/fix-passing-filter-params-to-vsa-stage-time-summary.yml
...d/fix-passing-filter-params-to-vsa-stage-time-summary.yml
+5
-0
ee/lib/gitlab/analytics/cycle_analytics/summary/group/base_time.rb
...tlab/analytics/cycle_analytics/summary/group/base_time.rb
+1
-1
ee/spec/lib/gitlab/analytics/cycle_analytics/group_stage_time_summary_spec.rb
...nalytics/cycle_analytics/group_stage_time_summary_spec.rb
+50
-1
No files found.
ee/changelogs/unreleased/fix-passing-filter-params-to-vsa-stage-time-summary.yml
0 → 100644
View file @
326d2782
---
title
:
Fix passing filter params to VSA time summary queries
merge_request
:
36441
author
:
type
:
fixed
ee/lib/gitlab/analytics/cycle_analytics/summary/group/base_time.rb
View file @
326d2782
...
...
@@ -45,7 +45,7 @@ module Gitlab
to:
@options
[
:to
]
||
DateTime
.
now
,
project_ids:
@options
[
:projects
],
current_user:
@current_user
}
}
.
merge
(
@options
.
slice
(
*::
Gitlab
::
Analytics
::
CycleAnalytics
::
RequestParams
::
FINDER_PARAM_NAMES
))
)
end
end
...
...
ee/spec/lib/gitlab/analytics/cycle_analytics/group_stage_time_summary_spec.rb
View file @
326d2782
...
...
@@ -8,14 +8,63 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::GroupStageTimeSummary do
let_it_be
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:from
)
{
1
.
day
.
ago
}
let
(
:to
)
{
nil
}
let
(
:options
)
{
{
from:
from
,
to:
to
,
current_user:
user
}
}
subject
{
described_class
.
new
(
group
,
options:
{
from:
from
,
to:
to
,
current_user:
user
}
).
data
}
subject
{
described_class
.
new
(
group
,
options:
options
).
data
}
around
do
|
example
|
Timecop
.
freeze
{
example
.
run
}
end
describe
'#lead_time'
do
describe
'issuable filter parameters'
do
let_it_be
(
:label
)
{
create
(
:group_label
,
group:
group
)
}
before
do
create
(
:closed_issue
,
project:
project
,
created_at:
1
.
day
.
ago
,
closed_at:
Time
.
zone
.
now
,
author:
user
,
labels:
[
label
])
end
context
'when `author_username` is given'
do
before
do
options
[
:author_username
]
=
user
.
username
end
it
'returns the correct lead time'
do
expect
(
subject
.
first
[
:value
]).
to
eq
(
'1.0'
)
end
end
context
'when unknown `author_username` is given'
do
before
do
options
[
:author_username
]
=
'unknown_user'
end
it
'returns `-`'
do
expect
(
subject
.
first
[
:value
]).
to
eq
(
'-'
)
end
end
context
'when `label_name` is given'
do
before
do
options
[
:label_name
]
=
[
label
.
name
]
end
it
'returns the correct lead time'
do
expect
(
subject
.
first
[
:value
]).
to
eq
(
'1.0'
)
end
end
context
'when unknown `label_name` is given'
do
before
do
options
[
:label_name
]
=
[
'unknown_label'
]
end
it
'returns `-`'
do
expect
(
subject
.
first
[
:value
]).
to
eq
(
'-'
)
end
end
end
context
'with `from` date'
do
let
(
:from
)
{
6
.
days
.
ago
}
...
...
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