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
a131d5ff
Commit
a131d5ff
authored
Jul 22, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix InvalidColumnReference error in VSA
parent
70039994
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
ee/changelogs/unreleased/fix-any-label-queryin-vsa.yml
ee/changelogs/unreleased/fix-any-label-queryin-vsa.yml
+5
-0
ee/spec/lib/gitlab/analytics/cycle_analytics/data_collector_spec.rb
...b/gitlab/analytics/cycle_analytics/data_collector_spec.rb
+16
-0
lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
+10
-2
No files found.
ee/changelogs/unreleased/fix-any-label-queryin-vsa.yml
0 → 100644
View file @
a131d5ff
---
title
:
Fix Any filter for labels in Value Stream Analytics
merge_request
:
37584
author
:
type
:
fixed
ee/spec/lib/gitlab/analytics/cycle_analytics/data_collector_spec.rb
View file @
a131d5ff
...
...
@@ -544,6 +544,22 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
it_behaves_like
'filter examples'
end
context
'when `Any` `label_name` is given'
do
let
(
:label
)
{
create
(
:group_label
,
group:
group
)
}
before
do
MergeRequests
::
UpdateService
.
new
(
merge_request
.
project
,
user
,
label_ids:
[
label
.
id
]
).
execute
(
merge_request
)
data_collector_params
[
:label_name
]
=
[
'Any'
]
end
it_behaves_like
'filter examples'
end
context
'when two labels are given'
do
let
(
:label1
)
{
create
(
:group_label
,
group:
group
)
}
let
(
:label2
)
{
create
(
:group_label
,
group:
group
)
}
...
...
lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
View file @
a131d5ff
...
...
@@ -82,7 +82,7 @@ module Gitlab
q
=
ordered_and_limited_query
.
joins
(
ci_build_join
)
.
select
(
build_table
[
:id
],
round_duration_to_seconds
.
as
(
'total_time'
)
)
.
select
(
build_table
[
:id
],
*
time_columns
)
results
=
execute_query
(
q
).
to_a
...
...
@@ -95,7 +95,7 @@ module Gitlab
def
records
results
=
ordered_and_limited_query
.
select
(
*
columns
,
round_duration_to_seconds
.
as
(
'total_time'
)
)
.
select
(
*
columns
,
*
time_columns
)
# using preloader instead of includes to avoid AR generating a large column list
ActiveRecord
::
Associations
::
Preloader
.
new
.
preload
(
...
...
@@ -106,6 +106,14 @@ module Gitlab
results
end
# rubocop: enable CodeReuse/ActiveRecord
def
time_columns
[
stage
.
start_event
.
timestamp_projection
.
as
(
'start_event_timestamp'
),
stage
.
end_event
.
timestamp_projection
.
as
(
'end_event_timestamp'
),
round_duration_to_seconds
.
as
(
'total_time'
)
]
end
end
end
end
...
...
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