Expand isReasonableGitURL

What does this MR do and why?

Ahead of deleting the FF import_by_url_new_page , I notice while updating spec/features/projects/new_project_spec.rb which tests the old URL Import form, that immediate feedback is expected when a user enters a localhost url:

https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/features/projects/new_project_spec.rb#L450

While the backend would correctly handle this case, it seems find to extend isReasonableGitURL to also check for some localhost in the new Vue forms : import_by_url_form.vue and import_by_url_to_existing_project_form.vue.

As a result, "Enter a valid URL" will display on blur after entering some local host urls. Note: This isn't a comprehensive check.

References

Clean up use of old URL import code

Screenshots or screen recordings

Before After
Screenshot 2026-04-17 at 5.44.53 PM.png Screenshot 2026-04-17 at 5.58.35 PM.png

How to set up and validate locally

  1. Ensure feature flag import_by_url_new_page is enabled
  2. In admin settings make sure Repository By URL is enabled in admin/application_settings/general#js-import-export-settings
  3. Navigate to a group -> Create Project -> Import Project -> Repository by URL
  4. Enter a url like http://127.0.0.0 and click tab. You should see the error prompt beneath the input.

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.

Related to #588515 (closed)

Edited by Oiza Baiye

Merge request reports

Loading
Loading