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
- Setup a custom group-level project template (see docs)
- Visit create new project page
- Choose "Create from template" -> "Group" -> pick project created in step 1
- Create project from the template
- Wait until the project is created
- Push a change to the project template (from step 1)
- Setup pull mirroring for the project to pull changes from the project template (see docs)
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin