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 |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Ensure feature flag
import_by_url_new_pageis enabled - In admin settings make sure Repository By URL is enabled in
admin/application_settings/general#js-import-export-settings - Navigate to a group -> Create Project -> Import Project -> Repository by URL
- 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)

