rules:needs (with feature-flag on on v16.1.2) has no effect
Summary
The new feature implemented from #31581 (closed) has no effect.
Steps to reproduce
- Make a pipeline as follows
stages:
- stop
- wipe
- deliver
- start
stop:
stage: stop
rules:
- if: '$CI_PIPELINE_TRIGGERED == null'
when: manual
needs: []
- if: '$CI_PIPELINE_TRIGGERED'
when: always # independent of other job's success
script:
- echo "stop"
wipedb:
stage: wipe
rules:
- if: '$CI_PIPELINE_TRIGGERED == null'
when: manual
needs: []
- if: '$CI_PIPELINE_TRIGGERED && $WIPE != null'
when: always # independent of other job's success
script:
- echo "wipe"
deliver:
stage: deliver
rules:
- if: '$CI_PIPELINE_TRIGGERED == null'
when: manual
needs: []
- if: '$CI_PIPELINE_TRIGGERED'
when: always # independent of other job's success
script:
- echo "deliver"
start:
stage: start
rules:
- if: '$CI_PIPELINE_TRIGGERED == null'
when: manual
needs: [ "stop" ]
- if: '$CI_PIPELINE_TRIGGERED'
script:
- echo "start"
- Commit the
.gitlab-cy.yamland go to the project's pipelines - observe the jobs in the pipeline.
What is the current bug behavior?
We get only a "gear icon" with a "play button" (for manual triggering) in the pipeline view for the first stage, and only when this stage is completed the other buttons for wipedb and start appear, but not for deliver (which is also unexpected).
What is the expected correct behavior?
The expectation is that if the pipeline is not triggered, all stages except stop can be immediately triggered manually, because they have empty needs.
Relevant logs and/or screenshots
I'm on v16.1.2 under docker, with the relevant feature flag enabled:
# podman exec -it g1tlab gitlab-rails console
--------------------------------------------------------------------------------
Ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]
GitLab: 16.1.2 (e60fc11f2d3) FOSS
GitLab Shell: 14.23.0
PostgreSQL: 13.11
------------------------------------------------------------[ booted in 15.12s ]
Loading production environment (Rails 6.1.7.2)
irb(main):001:0> Feature.enabled?(:introduce_rules_with_needs)
=> true
irb(main):002:0>
Output of checks
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)