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
d5f2b32a
Commit
d5f2b32a
authored
Mar 29, 2021
by
Markus Koller
Committed by
Douglas Barbosa Alexandre
Mar 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid N+1 queries in breadcrumbs
parent
08e972e0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+3
-1
changelogs/unreleased/326212-controller-projects-hookscontroller-index-executes-more-than-100-s.yml
...ojects-hookscontroller-index-executes-more-than-100-s.yml
+5
-0
spec/helpers/groups_helper_spec.rb
spec/helpers/groups_helper_spec.rb
+10
-0
No files found.
app/helpers/groups_helper.rb
View file @
d5f2b32a
...
...
@@ -120,7 +120,9 @@ module GroupsHelper
@has_group_title
=
true
full_title
=
[]
group
.
ancestors
.
reverse
.
each_with_index
do
|
parent
,
index
|
ancestors
=
group
.
ancestors
.
with_route
ancestors
.
reverse_each
.
with_index
do
|
parent
,
index
|
if
index
>
0
add_to_breadcrumb_dropdown
(
group_title_link
(
parent
,
hidable:
false
,
show_avatar:
true
,
for_dropdown:
true
),
location: :before
)
else
...
...
changelogs/unreleased/326212-controller-projects-hookscontroller-index-executes-more-than-100-s.yml
0 → 100644
View file @
d5f2b32a
---
title
:
Avoid N+1 queries in breadcrumbs
merge_request
:
57725
author
:
type
:
performance
spec/helpers/groups_helper_spec.rb
View file @
d5f2b32a
...
...
@@ -109,6 +109,16 @@ RSpec.describe GroupsHelper do
subject
end
it
'avoids N+1 queries'
do
control_count
=
ActiveRecord
::
QueryRecorder
.
new
do
helper
.
group_title
(
nested_group
)
end
expect
do
helper
.
group_title
(
very_deep_nested_group
)
end
.
not_to
exceed_query_limit
(
control_count
)
end
end
describe
'#share_with_group_lock_help_text'
do
...
...
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