Allow dependencies without needs, pulling artifacts from depended-on jobs
Current Behavior
I'm trying to create a pipeline that allows manually triggering job B, using job A's artifacts, upon failure of job A, while still allowing failure of job A to create an overall pipeline status of
| relationship | stages | can manually trigger job B? | pipeline |
|---|---|---|---|
| implicit | separate | no, shows as "skipped" | https://gitlab.com/Codym48/pipeline-rules/-/pipelines/1044859782 |
explicit via needs
|
separate | no, shows as "skipped" | https://gitlab.com/Codym48/pipeline-rules/-/pipelines/1044860768 |
explicit via dependencies
|
separate | no, shows as "skipped" | https://gitlab.com/Codym48/pipeline-rules/-/pipelines/1044864964 |
explicit via needs
|
same | no, shows as "skipped" | https://gitlab.com/Codym48/pipeline-rules/-/pipelines/1044865297 |
explicit via dependencies
|
same | yes, but doesn't pull artifacts from job A | https://gitlab.com/Codym48/pipeline-rules/-/pipelines/1044867572 |
I would expect dependencies without needs to work differently than this based on the documentation:
- The job status does not matter. If a job fails or it’s a manual job that isn’t triggered, no error occurs.
The job status does seem to matter, since failures of a previous stage prevent the dependent stage from running.
And that fourth row, which looks like a silent failure (it respects the dependency, not allowing a manual trigger until the depended-on job finishes, but then it silently doesn't pull the artifacts, see screenshot below with no "Downloading artifacts" section), seems like a bug?
The documentation doesn't mention that dependencies must come from previous stages to allow downloading artifacts. It used to say this in needs,
needs:is similar todependencies:in that it must use jobs from prior stages, meaning it's impossible to create circular dependencies. Depending on jobs in the current stage is not possible either, but support is planned.
but @marcel.amirault removed it in !68934 (merged) and I haven't found this limitation of dependencies: mentioned in any other documentation.
Proposal
Allow dependencies without needs. If job B depends on A without a need on A, allow B to run after A completes, downloading the artifacts from A, regardless of the status of A (pass or fail).
