Commit 51b69c9f authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch '329664-remove-feature-flag' into 'master'

Remove :find_remote_root_refs_inmemory feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!62501
parents f828d047 cf786e63
---
name: find_remote_root_refs_inmemory
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60583
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/329664
milestone: '13.12'
type: development
group: group::gitaly
default_enabled: true
...@@ -50,17 +50,11 @@ module Geo ...@@ -50,17 +50,11 @@ module Geo
end end
def update_root_ref def update_root_ref
if Feature.enabled?(:find_remote_root_refs_inmemory, default_enabled: :yaml)
authorization = ::Gitlab::Geo::RepoSyncRequest.new( authorization = ::Gitlab::Geo::RepoSyncRequest.new(
scope: repository.full_path scope: repository.full_path
).authorization ).authorization
project.update_root_ref(GEO_REMOTE_NAME, remote_url, authorization) project.update_root_ref(GEO_REMOTE_NAME, remote_url, authorization)
else
repository.with_config(jwt_authentication_header) do
project.update_root_ref(GEO_REMOTE_NAME, remote_url, nil)
end
end
end end
def execute_housekeeping def execute_housekeeping
......
...@@ -233,69 +233,6 @@ RSpec.describe Geo::RepositorySyncService, :geo do ...@@ -233,69 +233,6 @@ RSpec.describe Geo::RepositorySyncService, :geo do
context 'with non empty repositories' do context 'with non empty repositories' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
context 'with inmemory feature disabled' do
before do
stub_feature_flags(find_remote_root_refs_inmemory: false)
end
context 'when HEAD change' do
before do
allow(project.repository)
.to receive(:find_remote_root_ref)
.with('geo', url_to_repo, nil)
.and_return('feature')
end
it 'syncs gitattributes to info/attributes' do
expect(repository).to receive(:copy_gitattributes)
subject.execute
end
it 'updates the default branch with JWT credentials' do
expect(repository).to receive(:with_config)
.with("http.#{url_to_repo}.extraHeader" => anything)
.and_call_original
.twice
expect(project).to receive(:change_head).with('feature').once
subject.execute
end
end
context 'when HEAD does not change' do
before do
allow(project.repository)
.to receive(:find_remote_root_ref)
.with('geo', url_to_repo, nil)
.and_return(project.default_branch)
end
it 'syncs gitattributes to info/attributes' do
expect(repository).to receive(:copy_gitattributes)
subject.execute
end
it 'updates the default branch with JWT credentials' do
expect(repository).to receive(:with_config)
.with("http.#{url_to_repo}.extraHeader" => anything)
.and_call_original
.twice
expect(project).to receive(:change_head).with('master').once
subject.execute
end
end
end
context 'with inmemory feature enabled' do
before do
stub_feature_flags(find_remote_root_refs_inmemory: true)
end
context 'when HEAD change' do context 'when HEAD change' do
before do before do
allow(project.repository) allow(project.repository)
...@@ -320,7 +257,6 @@ RSpec.describe Geo::RepositorySyncService, :geo do ...@@ -320,7 +257,6 @@ RSpec.describe Geo::RepositorySyncService, :geo do
subject.execute subject.execute
end end
end
context 'when HEAD does not change' do context 'when HEAD does not change' do
before do before do
......
...@@ -45,18 +45,9 @@ module Gitlab ...@@ -45,18 +45,9 @@ module Gitlab
# The remote_name parameter is deprecated and will be removed soon. # The remote_name parameter is deprecated and will be removed soon.
def find_remote_root_ref(remote_name, remote_url, authorization) def find_remote_root_ref(remote_name, remote_url, authorization)
request = if Feature.enabled?(:find_remote_root_refs_inmemory, default_enabled: :yaml) request = Gitaly::FindRemoteRootRefRequest.new(repository: @gitaly_repo,
Gitaly::FindRemoteRootRefRequest.new(
repository: @gitaly_repo,
remote_url: remote_url, remote_url: remote_url,
http_authorization_header: authorization http_authorization_header: authorization)
)
else
Gitaly::FindRemoteRootRefRequest.new(
repository: @gitaly_repo,
remote: remote_name
)
end
response = GitalyClient.call(@storage, :remote_service, response = GitalyClient.call(@storage, :remote_service,
:find_remote_root_ref, request, timeout: GitalyClient.medium_timeout) :find_remote_root_ref, request, timeout: GitalyClient.medium_timeout)
......
...@@ -38,8 +38,8 @@ RSpec.describe Gitlab::GitalyClient::RemoteService do ...@@ -38,8 +38,8 @@ RSpec.describe Gitlab::GitalyClient::RemoteService do
let(:remote) { 'origin' } let(:remote) { 'origin' }
let(:url) { 'http://git.example.com/my-repo.git' } let(:url) { 'http://git.example.com/my-repo.git' }
let(:auth) { 'Basic secret' } let(:auth) { 'Basic secret' }
let(:expected_params) { { remote_url: url, http_authorization_header: auth } }
shared_examples 'a find_remote_root_ref call' do
it 'sends an find_remote_root_ref message and returns the root ref' do it 'sends an find_remote_root_ref message and returns the root ref' do
expect_any_instance_of(Gitaly::RemoteService::Stub) expect_any_instance_of(Gitaly::RemoteService::Stub)
.to receive(:find_remote_root_ref) .to receive(:find_remote_root_ref)
...@@ -61,27 +61,6 @@ RSpec.describe Gitlab::GitalyClient::RemoteService do ...@@ -61,27 +61,6 @@ RSpec.describe Gitlab::GitalyClient::RemoteService do
end end
end end
context 'with inmemory feature enabled' do
before do
stub_feature_flags(find_remote_root_refs_inmemory: true)
end
it_behaves_like 'a find_remote_root_ref call' do
let(:expected_params) { { remote_url: url, http_authorization_header: auth } }
end
end
context 'with inmemory feature disabled' do
before do
stub_feature_flags(find_remote_root_refs_inmemory: false)
end
it_behaves_like 'a find_remote_root_ref call' do
let(:expected_params) { { remote: remote } }
end
end
end
describe '#update_remote_mirror' do describe '#update_remote_mirror' do
let(:ref_name) { 'remote_mirror_1' } let(:ref_name) { 'remote_mirror_1' }
let(:only_branches_matching) { %w[my-branch master] } let(:only_branches_matching) { %w[my-branch master] }
......
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