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
6a5aa584
Commit
6a5aa584
authored
Apr 07, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove blobs_fetch_in_batches feature flag
parent
96df6dcd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
25 deletions
+12
-25
changelogs/unreleased/id-remove-blobs_fetch_in_batches-feature-flag.yml
...eleased/id-remove-blobs_fetch_in_batches-feature-flag.yml
+5
-0
lib/gitlab/git/blob.rb
lib/gitlab/git/blob.rb
+2
-6
spec/lib/gitlab/git/blob_spec.rb
spec/lib/gitlab/git/blob_spec.rb
+5
-19
No files found.
changelogs/unreleased/id-remove-blobs_fetch_in_batches-feature-flag.yml
0 → 100644
View file @
6a5aa584
---
title
:
Remove blobs_fetch_in_batches feature flag
merge_request
:
29069
author
:
type
:
added
lib/gitlab/git/blob.rb
View file @
6a5aa584
...
@@ -86,13 +86,9 @@ module Gitlab
...
@@ -86,13 +86,9 @@ module Gitlab
# to the caller to limit the number of blobs and blob_size_limit.
# to the caller to limit the number of blobs and blob_size_limit.
#
#
def
batch
(
repository
,
blob_references
,
blob_size_limit:
MAX_DATA_DISPLAY_SIZE
)
def
batch
(
repository
,
blob_references
,
blob_size_limit:
MAX_DATA_DISPLAY_SIZE
)
if
Feature
.
enabled?
(
:blobs_fetch_in_batches
,
default_enabled:
true
)
blob_references
.
each_slice
(
BATCH_SIZE
).
flat_map
do
|
refs
|
blob_references
.
each_slice
(
BATCH_SIZE
).
flat_map
do
|
refs
|
repository
.
gitaly_blob_client
.
get_blobs
(
refs
,
blob_size_limit
).
to_a
repository
.
gitaly_blob_client
.
get_blobs
(
refs
,
blob_size_limit
).
to_a
end
end
else
repository
.
gitaly_blob_client
.
get_blobs
(
blob_references
,
blob_size_limit
).
to_a
end
end
end
# Returns an array of Blob instances just with the metadata, that means
# Returns an array of Blob instances just with the metadata, that means
...
...
spec/lib/gitlab/git/blob_spec.rb
View file @
6a5aa584
...
@@ -301,7 +301,6 @@ describe Gitlab::Git::Blob, :seed_helper do
...
@@ -301,7 +301,6 @@ describe Gitlab::Git::Blob, :seed_helper do
stub_const
(
'Gitlab::Git::Blob::BATCH_SIZE'
,
2
)
stub_const
(
'Gitlab::Git::Blob::BATCH_SIZE'
,
2
)
end
end
context
'blobs_fetch_in_batches is enabled'
do
it
'fetches the blobs in batches'
do
it
'fetches the blobs in batches'
do
expect
(
client
).
to
receive
(
:get_blobs
).
with
(
first_batch
,
limit
).
ordered
expect
(
client
).
to
receive
(
:get_blobs
).
with
(
first_batch
,
limit
).
ordered
expect
(
client
).
to
receive
(
:get_blobs
).
with
(
second_batch
,
limit
).
ordered
expect
(
client
).
to
receive
(
:get_blobs
).
with
(
second_batch
,
limit
).
ordered
...
@@ -310,19 +309,6 @@ describe Gitlab::Git::Blob, :seed_helper do
...
@@ -310,19 +309,6 @@ describe Gitlab::Git::Blob, :seed_helper do
subject
subject
end
end
end
end
context
'blobs_fetch_in_batches is disabled'
do
before
do
stub_feature_flags
(
blobs_fetch_in_batches:
false
)
end
it
'fetches the blobs in a single batch'
do
expect
(
client
).
to
receive
(
:get_blobs
).
with
(
blob_references
,
limit
)
subject
end
end
end
end
end
describe
'.batch_metadata'
do
describe
'.batch_metadata'
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