Migrate "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)
As part of this refactoring, we may want to consider addressing some of the known issues on that page, such as:
- Repository import by URL throws "There is not a... (#366769)
- "Repository by URL" project import page sends i... (#461392)
Backend changes for migrating "Import from URL"... (#536989 - closed)
Backend changes - covered byTo 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@github.com:rails/rails")
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.