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
Hide 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
...
@@ -120,7 +120,9 @@ module GroupsHelper
@has_group_title
=
true
@has_group_title
=
true
full_title
=
[]
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
if
index
>
0
add_to_breadcrumb_dropdown
(
group_title_link
(
parent
,
hidable:
false
,
show_avatar:
true
,
for_dropdown:
true
),
location: :before
)
add_to_breadcrumb_dropdown
(
group_title_link
(
parent
,
hidable:
false
,
show_avatar:
true
,
for_dropdown:
true
),
location: :before
)
else
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
...
@@ -109,6 +109,16 @@ RSpec.describe GroupsHelper do
subject
subject
end
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
end
describe
'#share_with_group_lock_help_text'
do
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