Allow project import even when `shared_runners_enabled` conflicts with its group
Problem
About the new feature allowing to enable/disable shared runners and project import,
If shared runners are disabled for a group on destination (or on a gitlab.com parent group), it does not allow projects to import, mainly because field shared_runners_enabled=<boolean>
conflicts on import (by just being part of the exported archive) and returns:
"import_error": "Error importing repository into <group-full-path> - Validation failed: Shared runners enabled cannot be enabled because parent group does not allow it"
- being rescued on this line - http://gitlab.com/gitlab-org/gitlab/blob/b228b1568657c2a5d5724e6c7eca899bd47193e2/lib/gitlab/import_export/importer.rb#L32-32
- some issue importing file - http://gitlab.com/gitlab-org/gitlab/blob/b228b1568657c2a5d5724e6c7eca899bd47193e2/lib/gitlab/import_export/importer.rb#L48-48
- validation introduced in !36080 (merged)
Proposed solution
- Keep project value if
Allow projects and subgroups to override the group
setting is set, as it already does - Otherwise inherit group setting of disabled, if a project has enabled set
- Keep project setting of enabled/disabled, if group setting is enabled.
Workaround
Either:
- Ensure that shared runners is enabled on the parent group on the destination GitLab instance. Then retry the import.
- Disable shared runners on the project on the source GitLab instance and then export the project again. Then retry the import.
Edited by Doug Stull