Add error for cross pipeline dependencies
What does this MR do and why?
Fixes: undefined method 'pluck' for nil:NilClass
: #349974 (closed)
This can happen in two scenarios (or more?), but they both happen when we have a config that uses the keyword dependencies
.
Scenario 1 - if a dependency: job
is from a job that is supposed to be in the same pipeline but is also referenced as a cross pipeline dependency (so we don't know what it is actually referring to):
jobA:
script: echo "a"
jobB:
script: echo "b"
dependencies:
- jobA
needs:
- job: jobA
pipeline: other
Note: this can be fixed if the job: jobA
is added to the needs
Scenario 2 - if a dependency: job
is referring to a needs: job
that is another pipeline.
jobA:
script: echo "a"
jobB:
script: echo "b"
dependencies:
- jobX
needs:
- job: jobX
pipeline: other
In both cases, they should be using dependencies: job
to refer to a job in the same pipeline.
The easiest way to validate this is by pasting the config above in the pipeline editor on main
/master
and with this branch.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.