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
b5d11e60
Commit
b5d11e60
authored
Feb 26, 2020
by
charlieablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove filter from DescendantCountService
Remove usage of IssuesFinder, use Issue directly.
parent
a11f6d3c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
20 deletions
+15
-20
changelogs/unreleased/196718-remove-filter-epic-counts.yml
changelogs/unreleased/196718-remove-filter-epic-counts.yml
+5
-0
ee/app/services/epics/descendant_count_service.rb
ee/app/services/epics/descendant_count_service.rb
+2
-5
ee/spec/services/epics/descendant_count_service_spec.rb
ee/spec/services/epics/descendant_count_service_spec.rb
+8
-15
No files found.
changelogs/unreleased/196718-remove-filter-epic-counts.yml
0 → 100644
View file @
b5d11e60
---
title
:
Remove visibility check from epic descendant counts
merge_request
:
25975
author
:
type
:
changed
ee/app/services/epics/descendant_count_service.rb
View file @
b5d11e60
...
@@ -41,16 +41,13 @@ module Epics
...
@@ -41,16 +41,13 @@ module Epics
def
issues_count
def
issues_count
strong_memoize
(
:issue_counts
)
do
strong_memoize
(
:issue_counts
)
do
Issue
sFinder
.
new
(
current_user
).
execute
.
in_epics
(
accessible_epics
).
counts_by_state
Issue
.
in_epics
(
accessible_epics
).
counts_by_state
end
end
end
end
def
accessible_epics
def
accessible_epics
strong_memoize
(
:epics
)
do
strong_memoize
(
:epics
)
do
epics
=
epic
.
base_and_descendants
epic
.
base_and_descendants
epic_groups
=
Group
.
for_epics
(
epics
)
groups
=
Group
.
groups_user_can_read_epics
(
epic_groups
,
current_user
,
same_root:
true
)
epics
.
in_selected_groups
(
groups
)
end
end
end
end
end
end
...
...
ee/spec/services/epics/descendant_count_service_spec.rb
View file @
b5d11e60
...
@@ -15,10 +15,14 @@ describe Epics::DescendantCountService do
...
@@ -15,10 +15,14 @@ describe Epics::DescendantCountService do
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
state: :closed
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
state: :closed
)
}
let_it_be
(
:issue3
)
{
create
(
:issue
,
project:
project
,
state: :opened
)
}
let_it_be
(
:issue3
)
{
create
(
:issue
,
project:
project
,
state: :opened
)
}
let_it_be
(
:issue4
)
{
create
(
:issue
,
project:
project
,
state: :closed
)
}
let_it_be
(
:issue4
)
{
create
(
:issue
,
project:
project
,
state: :closed
)
}
let_it_be
(
:issue5
)
{
create
(
:issue
,
:confidential
,
project:
project
,
state: :opened
)
}
let_it_be
(
:issue6
)
{
create
(
:issue
,
:confidential
,
project:
project
,
state: :closed
)
}
let_it_be
(
:epic_issue1
)
{
create
(
:epic_issue
,
epic:
parent_epic
,
issue:
issue1
)
}
let_it_be
(
:epic_issue1
)
{
create
(
:epic_issue
,
epic:
parent_epic
,
issue:
issue1
)
}
let_it_be
(
:epic_issue2
)
{
create
(
:epic_issue
,
epic:
parent_epic
,
issue:
issue2
)
}
let_it_be
(
:epic_issue2
)
{
create
(
:epic_issue
,
epic:
parent_epic
,
issue:
issue2
)
}
let_it_be
(
:epic_issue3
)
{
create
(
:epic_issue
,
epic:
epic1
,
issue:
issue3
)
}
let_it_be
(
:epic_issue3
)
{
create
(
:epic_issue
,
epic:
epic1
,
issue:
issue3
)
}
let_it_be
(
:epic_issue4
)
{
create
(
:epic_issue
,
epic:
epic2
,
issue:
issue4
)
}
let_it_be
(
:epic_issue4
)
{
create
(
:epic_issue
,
epic:
epic2
,
issue:
issue4
)
}
let_it_be
(
:epic_issue5
)
{
create
(
:epic_issue
,
epic:
epic1
,
issue:
issue5
)
}
let_it_be
(
:epic_issue6
)
{
create
(
:epic_issue
,
epic:
epic2
,
issue:
issue6
)
}
subject
{
described_class
.
new
(
parent_epic
,
user
)
}
subject
{
described_class
.
new
(
parent_epic
,
user
)
}
...
@@ -27,19 +31,8 @@ describe Epics::DescendantCountService do
...
@@ -27,19 +31,8 @@ describe Epics::DescendantCountService do
stub_licensed_features
(
epics:
true
)
stub_licensed_features
(
epics:
true
)
end
end
it
'does not count inaccessible epics'
do
it
'includes inaccessible epics'
do
expect
(
subject
.
public_send
(
method
)).
to
eq
0
expect
(
subject
.
public_send
(
method
)).
to
eq
expected_count
end
context
'when authorized'
do
before
do
subgroup
.
add_developer
(
user
)
project
.
add_developer
(
user
)
end
it
'returns correct number of epics'
do
expect
(
subject
.
public_send
(
method
)).
to
eq
expected_count
end
end
end
end
end
...
@@ -52,10 +45,10 @@ describe Epics::DescendantCountService do
...
@@ -52,10 +45,10 @@ describe Epics::DescendantCountService do
end
end
describe
'#opened_issues'
do
describe
'#opened_issues'
do
it_behaves_like
'descendants state count'
,
:opened_issues
,
2
it_behaves_like
'descendants state count'
,
:opened_issues
,
3
end
end
describe
'#closed_issues'
do
describe
'#closed_issues'
do
it_behaves_like
'descendants state count'
,
:closed_issues
,
2
it_behaves_like
'descendants state count'
,
:closed_issues
,
3
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