Jobs using extends fail to inherit rules
Summary
When using extends
to pass an inheriting job rules
, the rules are not respected. Based on the current usage docs, the last member in the extends
collection should set rules
for the job definition, however that does not seem to be the case.
Steps to reproduce
- Extend a job using
rules
- Test evaluation conditions in parent job that should evaluate to true (i.e.
$CI_MERGE_REQUEST_ID
within MR)
Example Project
https://gitlab.com/theoretick/extends-rule-test/-/merge_requests/1
What is the current bug behavior?
rules
inherited from parent are not respected
What is the expected correct behavior?
rules
inherited from parent should be respected
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)
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)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)