Pipelines' tags are not exported/imported properly
Summary
A customer is importing a project from SaaS to Self-managed. They are using their own group runners, and added tags to their jobs. After importing the projects, the old pipelines cannot be retriggered. They give error message This job is stuck because the project doesn't have any runners online assigned to it
despite using the same runners whoch are active and connected.
We were able to reproduce the issue on GitLab.com.
Ticket: (Internal link)
Steps to reproduce
- Create a project with a simple pipeline:
stages:
- build
build:
stage: build
tags:
- shell
- build
script:
- echo "test importing tags"
- Register a group runner that only runs tagged jobs and add those tags to it.
- Run pipeline with those tags.
- Export the project.
- Create a new project by importing the gitlab export, and ensure the same runner is available for it.
- Check the pipeline history, you will find the pipeline with no tags, and cannot be retried.
- Pushing any changes to trigger a new pipeline, it works perfectly and the tags are available.
What is the current bug behavior?
The old pipelines in the imported project don't have any tags, and cannot be retriggered if no shared runner is available
What is the expected correct behavior?
Tags are exported and old pipeline can be retriggered
Relevant logs and/or screenshots
The original job tags:
The import job with no tags:
The available runner:
Output of checks
This bug happens on GitLab.com and also reported by a customer on Gitlab self-managed version 13.10.2-ee
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
As a workaround, by allowing at least one runner to run untagged jobs, the old pipelines can be retriggered.