resource_group in jobs is not expanding variables
Summary
Specifying resource_group
in a CI job using a CI variable doesn't work
Steps to reproduce
- Create a CI job (sleep 120) that runs on merge requests
- Specify
resource_group: ${CI_COMMIT_REF_SLUG-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
for the job - Create two merge requests from the same working branch, to two different target branches
- Commit something to the working branch > two MR pipelines will be created
- Watch as the job for one target branch waits for the job running for the second target branch
Example Project
What is the current bug behavior?
Job is waiting for resource: ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
What is the expected correct behavior?
Job only waits if two jobs are running for the same branch. (commit pipeline for target branch A, whilst also running MR pipeline for merge to target branch A)
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
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)