✕
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](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/196137#note_2599459707) review. When attachments are uploaded to Github they are linked to via a reference that includes the hostname: ![github_hostname](https://gitlab.com/-/project/278964/uploads/4f5bf9d582f386bb1bc25a857654b95e/Screenshot_2025-07-02_at_11.24.26.png) 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](https://gitlab.com/gitlab-org/gitlab/-/blob/4c64a5291f506de16fcfe084f522d066da713522/lib/gitlab/github_import/markdown_text.rb#L37-42), which doesn't consider the custom domain provided in the API. This also impacts merge request and issue [references](https://gitlab.com/gitlab-org/gitlab/-/blob/4c64a5291f506de16fcfe084f522d066da713522/lib/gitlab/github_import/markdown_text.rb#L84) 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_data` is saved to the `project_import_data` table 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.
issue