[go: up one dir, main page]

Skip to content

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:

github_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. Thisimport_datais saved to theproject_import_datatable in atext` 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.

Edited by 🤖 GitLab Bot 🤖