Validate if an actual GIT repo is behind the URL when importing Repo by URL
Problem to solve
Per this comment, enforcing .git in the URL when importing impacted a customer in internal ticket who can no longer use Import from URL feature to import projects from xp-dev.com. It seems like there are platforms that don't necessarily expose URLs ending with .git.
Steps to reproduce
- Create an account at xp-dev.com (they have 30 days trial with no credit card information) - > Create a test project
- Try importing that project to GitLab using Import by URL feature.
- Unable to find a way to get a URL ending with
.git
Proposed solution
A 3-step solution was proposed in this comment:
- Revert current MR (#331803 (closed))
- Switch from "error message" to "warning" (#331641 (closed))
- Switch from "dummy error message" to making real backend-based validation "if the supplied URL feels like GIT url" (this issue)
This issue implements step 3: Implement a backend-based validation of the URL to check if there is an actual git repo behind it. This check would prevent a wider range of errors - from "typo in url" to "incorrect credentials". If the validation fails, the next action would be disabled, similar to the original solution. We should also consider providing an ability to override this validation warning for cases when the git service is temporarily not reachable.