Align gitlab.com github_hostname formatting with self-managed when Importing repos from GHE
Overview - current
When using the GitHub Importer to import repos from a GitHub Enterprise (GHE) instance we have the option to pass the argument github_hostname
to the API.
The importer would otherwise default to github.com.
When we POST a custom github_hostname
we expect it to be appended by /api/v3
(GHE API) and able to clone the repo.
This is true for GitLab self-managed.
However, when we attempt the same to gitlab.com it results in 422 Unprocessable Entity
with response body:
{
"errors": "Import failed due to a GitHub error: "
}
Once one appends /api/v3
i.e. "github_hostname": "https://<url>/api/v3"
the request is successful (201
) and the repo is cloned.
Expected
The GitHub importer should behave the same on GitLab self-managed and SaaS.
It should append /api/v3
to a non-empty github_hostname
argument, passed as part of the POST request to the (GitHub) Import API.