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
266e3179
Commit
266e3179
authored
Mar 16, 2020
by
Coung Ngo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put back deleted :unfiltered_epic_aggregates feature flag test
Put back test since we are just defaulting flags to on
parent
44df1a11
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
ee/app/graphql/types/epic_type.rb
ee/app/graphql/types/epic_type.rb
+3
-1
ee/spec/requests/api/graphql/group/epic/epic_aggregate_query_spec.rb
...uests/api/graphql/group/epic/epic_aggregate_query_spec.rb
+48
-0
No files found.
ee/app/graphql/types/epic_type.rb
View file @
266e3179
...
@@ -135,8 +135,10 @@ module Types
...
@@ -135,8 +135,10 @@ module Types
field
:descendant_weight_sum
,
Types
::
EpicDescendantWeightSumType
,
null:
true
,
complexity:
10
,
field
:descendant_weight_sum
,
Types
::
EpicDescendantWeightSumType
,
null:
true
,
complexity:
10
,
description:
"Total weight of open and closed issues in the epic and its descendants"
,
description:
"Total weight of open and closed issues in the epic and its descendants"
,
resolve:
->
(
epic
,
args
,
ctx
)
do
resolve:
->
(
epic
,
args
,
ctx
)
do
if
Feature
.
enabled?
(
:unfiltered_epic_aggregates
,
epic
.
group
,
default_enabled:
true
)
Gitlab
::
Graphql
::
Aggregations
::
Epics
::
LazyEpicAggregate
.
new
(
ctx
,
epic
.
id
,
WEIGHT_SUM
)
Gitlab
::
Graphql
::
Aggregations
::
Epics
::
LazyEpicAggregate
.
new
(
ctx
,
epic
.
id
,
WEIGHT_SUM
)
end
end
end
field
:health_status
,
Types
::
EpicHealthStatusType
,
null:
true
,
complexity:
10
,
field
:health_status
,
Types
::
EpicHealthStatusType
,
null:
true
,
complexity:
10
,
description:
'Current health status of the epic'
,
description:
'Current health status of the epic'
,
...
...
ee/spec/requests/api/graphql/group/epic/epic_aggregate_query_spec.rb
View file @
266e3179
...
@@ -108,5 +108,53 @@ describe 'Epic aggregates (count and weight)' do
...
@@ -108,5 +108,53 @@ describe 'Epic aggregates (count and weight)' do
)
)
end
end
end
end
context
'with feature flag disabled'
do
before
do
stub_feature_flags
(
unfiltered_epic_aggregates:
false
)
end
context
'when requesting counts'
do
let
(
:epic_aggregates_query
)
do
<<~
QUERY
nodes {
descendantCounts {
openedEpics
closedEpics
openedIssues
closedIssues
}
}
QUERY
end
it
'uses the DescendantCountService'
do
expect
(
Epics
::
DescendantCountService
).
to
receive
(
:new
)
post_graphql
(
query
,
current_user:
current_user
)
end
it_behaves_like
'counts properly'
end
context
'when requesting weights'
do
let
(
:epic_aggregates_query
)
do
<<~
QUERY
nodes {
descendantWeightSum {
openedIssues
closedIssues
}
}
QUERY
end
it
'returns nil'
do
post_graphql
(
query
,
current_user:
current_user
)
expect
(
subject
).
to
include
(
a_hash_including
(
'descendantWeightSum'
=>
nil
))
end
end
end
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