Commit df8b61be authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ps-find-remote-is-storage-scoped' into 'master'

FindRemoteRepository is storage scoped

See merge request gitlab-org/gitlab!35962
parents 2556532b f6d596bb
---
title: FindRemoteRepository is storage scoped
merge_request: 35962
author:
type: added
......@@ -8,9 +8,11 @@ module Gitlab
MAX_MSG_SIZE = 128.kilobytes.freeze
def self.exists?(remote_url)
request = Gitaly::FindRemoteRepositoryRequest.new(remote: remote_url)
storage = GitalyClient.random_storage
response = GitalyClient.call(GitalyClient.random_storage,
request = Gitaly::FindRemoteRepositoryRequest.new(remote: remote_url, storage_name: storage)
response = GitalyClient.call(storage,
:remote_service,
:find_remote_repository, request,
timeout: GitalyClient.medium_timeout)
......
......@@ -73,8 +73,11 @@ RSpec.describe Gitlab::GitalyClient::RemoteService do
describe '.exists?' do
context "when the remote doesn't exist" do
let(:url) { 'https://gitlab.com/gitlab-org/ik-besta-niet-of-ik-word-geplaagd.git' }
let(:storage_name) { 'default' }
it 'returns false' do
expect(Gitaly::FindRemoteRepositoryRequest).to receive(:new).with(remote: url, storage_name: storage_name).and_call_original
expect(described_class.exists?(url)).to be(false)
end
end
......
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