Skip to content

Child pipeline artifacts cannot be downloaded via ref-based links

Summary

Artifacts from jobs in child pipelines cannot be downloaded via the instructions in the docs, e.g.:

https://gitlab.com/rsrchboy/scratch/-/jobs/artifacts/child-artifacts/raw/admiralty.txt?job=build-child

Steps to reproduce

  1. Create a child pipeline containing a job that generates artifacts.
  2. Attempt to download artifact from the "child job".

Example Project

I've created a scratch repo/pipeline to demonstrate this:

https://gitlab.com/rsrchboy/scratch/commits/child-artifacts

The parent and child pipelines both contain jobs that generate artifacts.

What is the current bug behavior?

The latest artifacts from the job in the parent pipeline can be downloaded, e.g.:

$ curl --location https://gitlab.com/rsrchboy/scratch/-/jobs/artifacts/child-artifacts/raw/artifacty\?job\=build-parent
I am the model of a modern major general

...while they cannot from the child pipeline:

$ curl -v https://gitlab.com/rsrchboy/scratch/-/jobs/artifacts/child-artifacts/raw/admiralty.txt\?job\=build-child
<...snip...>
> GET /rsrchboy/scratch/-/jobs/artifacts/child-artifacts/raw/admiralty.txt?job=build-child HTTP/1.1
> Host: gitlab.com
> User-Agent: curl/7.67.0
> Accept: */*
<...snip...>
< HTTP/1.1 404 Not Found
<...snip...>

What is the expected correct behavior?

I'd expect the artifact from the child job to be fetched in the same fashion as the artifact in the parent job:

$ curl --location https://gitlab.com/rsrchboy/scratch/-/jobs/artifacts/child-artifacts/raw/admiralty.txt\?job\=build-child
I am the monarch of the sea

Relevant logs and/or screenshots

Logs, etc, can all be found in the pipelines at:

Output of checks

This bug happens on GitLab.com.

Proposal

There is a proposal MR !29710 (merged) that describes the direction we can take to solve this problem. It needs to be completed.

Edited by Fabio Pitino