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
7ea96af5
Commit
7ea96af5
authored
Apr 20, 2021
by
Imre Farkas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using linear queries when traversal_ids is blank
parent
631f94b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
app/models/namespaces/traversal/linear.rb
app/models/namespaces/traversal/linear.rb
+3
-1
spec/lib/gitlab/object_hierarchy_spec.rb
spec/lib/gitlab/object_hierarchy_spec.rb
+1
-1
spec/models/namespace_spec.rb
spec/models/namespace_spec.rb
+3
-1
No files found.
app/models/namespaces/traversal/linear.rb
View file @
7ea96af5
...
...
@@ -52,7 +52,9 @@ module Namespaces
end
def
use_traversal_ids?
Feature
.
enabled?
(
:use_traversal_ids
,
root_ancestor
,
default_enabled: :yaml
)
return
false
unless
Feature
.
enabled?
(
:use_traversal_ids
,
root_ancestor
,
default_enabled: :yaml
)
traversal_ids
.
present?
end
def
self_and_descendants
...
...
spec/lib/gitlab/object_hierarchy_spec.rb
View file @
7ea96af5
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
Gitlab
::
ObjectHierarchy
do
let_it_be
(
:parent
)
{
create
(
:group
)
}
let_it_be
(
:parent
,
reload:
true
)
{
create
(
:group
)
}
let_it_be
(
:child1
)
{
create
(
:group
,
parent:
parent
)
}
let_it_be
(
:child2
)
{
create
(
:group
,
parent:
child1
)
}
...
...
spec/models/namespace_spec.rb
View file @
7ea96af5
...
...
@@ -880,7 +880,7 @@ RSpec.describe Namespace do
end
describe
'#use_traversal_ids?'
do
let_it_be
(
:namespace
)
{
build
(
:namespace
)
}
let_it_be
(
:namespace
,
reload:
true
)
{
create
(
:namespace
)
}
subject
{
namespace
.
use_traversal_ids?
}
...
...
@@ -902,6 +902,8 @@ RSpec.describe Namespace do
end
context
'when use_traversal_ids feature flag is true'
do
let_it_be
(
:namespace
,
reload:
true
)
{
create
(
:namespace
)
}
it_behaves_like
'namespace traversal'
describe
'#self_and_descendants'
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