Commit a795f0fa authored by David Kim's avatar David Kim

Merge branch 'pks-ff-git-access-batched-changes-size-default' into 'master'

Remove flag guarding batched computation of changes size

See merge request gitlab-org/gitlab!66527
parents 4a7db562 02755cd5
---
name: git_access_batched_changes_size
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64503
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334130
milestone: '14.1'
type: development
group: group::gitaly
default_enabled: false
...@@ -498,21 +498,10 @@ module Gitlab ...@@ -498,21 +498,10 @@ module Gitlab
end end
def check_changes_size def check_changes_size
changes_size = revs = ['--not', '--all', '--not']
if Feature.enabled?(:git_access_batched_changes_size, project, default_enabled: :yaml) revs += changes_list.map { |change| change[:newrev] }
revs = ['--not', '--all', '--not']
revs += changes_list.map { |change| change[:newrev] }
repository.blobs(revs).sum(&:size) changes_size = repository.blobs(revs).sum(&:size)
else
changes_size = 0
changes_list.each do |change|
changes_size += repository.new_blobs(change[:newrev]).sum(&:size)
end
changes_size
end
check_size_against_limit(changes_size) check_size_against_limit(changes_size)
end end
......
...@@ -382,12 +382,11 @@ RSpec.describe Gitlab::GitAccessSnippet do ...@@ -382,12 +382,11 @@ RSpec.describe Gitlab::GitAccessSnippet do
it_behaves_like 'a push to repository to make it over the limit' it_behaves_like 'a push to repository to make it over the limit'
end end
shared_examples_for 'a change with GIT_OBJECT_DIRECTORY_RELATIVE env var unset' do context 'a change with GIT_OBJECT_DIRECTORY_RELATIVE env var unset' do
let(:change_size) { 200 } let(:change_size) { 200 }
before do before do
stub_feature_flags(git_access_batched_changes_size: batched) allow(snippet.repository).to receive(:blobs).and_return(
allow(snippet.repository).to receive(expected_call).and_return(
[double(:blob, size: change_size)] [double(:blob, size: change_size)]
) )
end end
...@@ -396,20 +395,6 @@ RSpec.describe Gitlab::GitAccessSnippet do ...@@ -396,20 +395,6 @@ RSpec.describe Gitlab::GitAccessSnippet do
it_behaves_like 'a push to repository below the limit' it_behaves_like 'a push to repository below the limit'
it_behaves_like 'a push to repository to make it over the limit' it_behaves_like 'a push to repository to make it over the limit'
end end
context 'when batched computation is enabled' do
let(:batched) { true }
let(:expected_call) { :blobs }
it_behaves_like 'a change with GIT_OBJECT_DIRECTORY_RELATIVE env var unset'
end
context 'when batched computation is disabled' do
let(:batched) { false }
let(:expected_call) { :new_blobs }
it_behaves_like 'a change with GIT_OBJECT_DIRECTORY_RELATIVE env var unset'
end
end end
describe 'HEAD realignment' do describe 'HEAD realignment' 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