Commit fff7ebeb authored by Max Woolf's avatar Max Woolf

Merge branch 'pks-drop-set-config' into 'master'

Always use `SetFullPath` RPC

See merge request gitlab-org/gitlab!68745
parents e906f85f 76dd0f25
---
name: set_full_path
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66929
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/337002
milestone: '14.2'
type: development
group: group::gitaly
default_enabled: false
......@@ -898,17 +898,7 @@ module Gitlab
# This guard avoids Gitaly log/error spam
raise NoRepository, 'repository does not exist' unless exists?
if Feature.enabled?(:set_full_path)
gitaly_repository_client.set_full_path(full_path)
else
set_config('gitlab.fullpath' => full_path)
end
end
def set_config(entries)
wrapped_gitaly_errors do
gitaly_repository_client.set_config(entries)
end
end
def disconnect_alternates
......
......@@ -264,25 +264,6 @@ module Gitlab
nil
end
def set_config(entries)
return if entries.empty?
request = Gitaly::SetConfigRequest.new(repository: @gitaly_repo)
entries.each do |key, value|
request.entries << build_set_config_entry(key, value)
end
GitalyClient.call(
@storage,
:repository_service,
:set_config,
request,
timeout: GitalyClient.fast_timeout
)
nil
end
def license_short_name
request = Gitaly::FindLicenseRequest.new(repository: @gitaly_repo)
......
......@@ -1710,7 +1710,6 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
end
describe '#set_full_path' do
shared_examples '#set_full_path' do
before do
repository_rugged.config["gitlab.fullpath"] = repository_path
end
......@@ -1750,46 +1749,6 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
end
end
context 'with :set_full_path enabled' do
before do
stub_feature_flags(set_full_path: true)
end
it_behaves_like '#set_full_path'
end
context 'with :set_full_path disabled' do
before do
stub_feature_flags(set_full_path: false)
end
it_behaves_like '#set_full_path'
end
end
describe '#set_config' do
let(:repository) { mutable_repository }
let(:entries) do
{
'test.foo1' => 'bla bla',
'test.foo2' => 1234,
'test.foo3' => true
}
end
it 'can set config settings' do
expect(repository.set_config(entries)).to be_nil
expect(repository_rugged.config['test.foo1']).to eq('bla bla')
expect(repository_rugged.config['test.foo2']).to eq('1234')
expect(repository_rugged.config['test.foo3']).to eq('true')
end
after do
entries.keys.each { |k| repository_rugged.config.delete(k) }
end
end
describe '#merge_to_ref' do
let(:repository) { mutable_repository }
let(:branch_head) { '6d394385cf567f80a8fd85055db1ab4c5295806f' }
......
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