Update GH import accommodate github_hostname when triggering import via api
When importing from GitHub we don't currently support GHE hostnames when validating attachment download links. This was confirmed in the course of this MR review.
When attachments are uploaded to Github they are linked to via a reference that includes the hostname:
Attachment downloads don't work when the migration is triggered via GitHub Import API by providing the GHE server hostname because the regular expression to extract the URLs uses the method Gitlab::GithubImport::MarkdownText#github_url, which doesn't consider the custom domain provided in the API.
This also impacts merge request and issue references which aren't getting updated as well because the code also uses Gitlab::GithubImport::MarkdownText#github_url
Part of the solution will be to update Gitlab::GithubImport::Settings
to include a github_hostname
in the import_data
. This can be included as an optional param
in POST /import/github
. This
import_datais saved to the
project_import_datatable in a
text` column so we should not need to add a column. We'll then be able to access it during url construction.
We also need to add logic to parse the attachment urls in a way to accommodate GHE hostnames.