Commit b6c2cc36 authored by Alper Akgun's avatar Alper Akgun

Merge branch 'issue_243606-improve_epic_swimlanes_query' into 'master'

Improve epic swimlanes loading performance for group issue board

See merge request gitlab-org/gitlab!75378
parents dc54887d 42de05b8
......@@ -36,6 +36,7 @@ module Resolvers
list_service.execute.in_epics(accessible_epics).distinct_epic_ids
end
# rubocop: disable CodeReuse/ActiveRecord
def accessible_epics
EpicsFinder.new(
context[:current_user],
......@@ -43,8 +44,9 @@ module Resolvers
state: :opened,
include_ancestor_groups: true,
include_descendant_groups: board.group_board?
).execute
).execute.reorder(nil) # Not having order here increases performance, epics will be ordering on parent query anyway.
end
# rubocop: enable CodeReuse/ActiveRecord
def group
board.project_board? ? board.project.group : board.group
......
......@@ -64,7 +64,7 @@ RSpec.describe Resolvers::BoardGroupings::EpicsResolver do
it 'finds all epics for issues in the group board' do
result = resolve_board_epics(group_board)
expect(result).to match_array([epic1, epic2, epic3])
expect(result).to eq([epic1, epic2, epic3])
end
it 'finds only epics for issues matching issue filters' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment