Backend changes for migrating "Import from URL" to vue
As part of the "New project creation" form/flow, we should migrate the "Import from URL" page to Vue. This will become available behind the new_project_creation_form
.
This is related to #514700 (closed)
Backend changes
To support the git, HTTP, and HTTPS schemas, we can change the Import::ValidateRemoteGitEndpointService service to use Gitlab::GitalyClient::RemoteService.exists?
method instead of using Gitlab::HTTP
to discover if the repositories exist
Follow example on how to use the Gitlab::GitalyClient::RemoteService.exists?
method
HTTPS - Public
Gitlab::GitalyClient::RemoteService.exists?("https://github.com/rails/rails")
HTTPS - Private
Gitlab::GitalyClient::RemoteService.exists?("https://rodrigotomonari:ACCESS_TOKEN@github.com/rodrigotomonari/test-private.git")
GIT - Public
Gitlab::GitalyClient::RemoteService.exists?("git://git.kernel.org/pub/scm/bluetooth/bluez.git")
The method only returns true
or false
. Therefore, we may not know if the credentials are invalid or if the URL is invalid. When the method returns false, we should return a generic message stating that it was not possible to access the repository.