Skip to content
Snippets Groups Projects

Ensure import by URL works after a failed import

Merged Stan Hu requested to merge sh-fix-import-by-url-retries into master
  1. Mar 19, 2020
    • Stan Hu's avatar
      Ensure import by URL works after a failed import · 680c5313
      Stan Hu authored
      If a project fails to import a project with one of the built-in
      importers (e.g. GitHub, Bitbucket, GitLab project templates, etc.), a
      user will be redirected to the `/import/new` page. The user can attempt
      to import with a Git repository URL, but that would also fail because
      `import_type` remained what it was set to initially
      (e.g. `gitlab_project`). This caused `ImportService` to use the previous
      importer instead of attempting to use the URL.
      
      To fix this problem, we set `import_type` to `git` whenever the import
      by URL parameters are used. This is mapped to a `nil` importer in
      `Gitlab::ImportSources`.
      
      Closes #31589
      680c5313
Loading