Expose if there are any open/blocking requirements in a CI variable
Related to &2859 (closed):
"If a project has any blocking requirements a 'Requirements' job is automatically added to the pipeline;"
If we pass whether there are some blocking/open requirements in a CI variable we can then use workflow rules in CI yml file to conditionally include the manual job for marking all jobs as passed.
Supposing the CI variable name would be a boolean variable CI_HAS_OPEN_REQUIREMENTS
, then the manual job can be made conditional with something like this:
job:
rules:
- if: $CI_HAS_OPEN_REQUIREMENTS == "true"
when: manual
- when: never
when: manual
allow_failure: false
script:
- mkdir tmp
- echo "{\"*\":\"passed\"}" > tmp/artifacts.json
artifacts:
reports:
requirements: tmp/artifacts.json
Edited by Jan Provaznik