Skip to content

Fix pull mirroring for projects created from templates

What does this MR do and why?

Contributes to #390932 (closed)

Problem

When the project has import_type: gitlab_custom_project_template we block add_import_job because custom project templates relies on add_export_job for processing.

But, it also blocks any future attempts to setup a pull mirroring for these projects.

Solution

Block add_import_job only when the project is created and doesn't have a repository. When the repository is present, then it means that the initial template import was successful and we can run a pull mirroring job.

How to set up and validate locally

  1. Setup a custom group-level project template (see docs)
  2. Visit create new project page
  3. Choose "Create from template" -> "Group" -> pick project created in step 1
  4. Create project from the template
  5. Wait until the project is created
  6. Push a change to the project template (from step 1)
  7. Setup pull mirroring for the project to pull changes from the project template (see docs)
  8. You should see changes from step 6 in the project repository when the mirroring is completed

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vasilii Iakliushin

Merge request reports

Loading