Skip to content

Update Import::ValidateRemoteGitEndpoint Service

What does this MR do and why?

This change simplifies the Git repository URL validation process when importing repository via URL. Instead of manually checking if a URL points to a valid Git repository by making HTTP requests and parsing responses, the code now uses GitLab's built-in Gitaly client service to verify repository existence Gitlab::GitalyClient::RemoteService.exists?.

References

#536989 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Open /projects/new#import_project page
  2. Enter public http url for a git repo - verify it validates the url and does not show an error in the UI and the import should succeed
  3. Enter private http url with username/password embedded in the url - it should not show any errors and the import should succeed
  4. Enter private http url with username/password entered in the input fields - it should not show any errors and the import should succeed
  5. Enter git:// protocol url without username/password (e.g. git://git.kernel.org/pub/scm/bluetooth/bluez.git) -- it should not show any errors and the import should succeed
  6. Enter http url with incorrect credentials - verify error is shown

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading