Failing .pipeline-policy-pre stage should fail the pipeline to prevent jobs with empty needs from running

Why are we doing this work

In #469256 (closed), we've implemented a special handling for .pipeline-policy-pre stage. All jobs with needs: [] have to wait until this stage finishes.

However, if the stage fails, the jobs still run. This behavior is rather unexpected and should be tweaked.

image

We have a similar issue #494293 (closed) which is about adding a configuration option for failing the pipeline if a policy job fails.

Relevant links

Implementation plan

Verification steps

Edited by 🤖 GitLab Bot 🤖