Latest artifacts for ref 404 when ref pipeline is being run
Summary
When a new CI process is launched for a branch, the latest artifacts on that branch become inaccessible (404). Based on the documentation
The latest artifacts are considered as the artifacts created by jobs in the latest pipeline that succeeded for the specific ref.
I would expect that the most recent successful pipeline e.g., the one that succeeded prior to the one that is running, is used for artifacts. For production branches that have long CI builds this is particularly problematic as the artifacts become unavailable to any clients during the build.
This may be related to https://gitlab.com/gitlab-org/gitlab-ce/issues/61730 in terms of cause, but the conditions for reproducing reported here are different.
Steps to reproduce
Given a pipeline with jobs that produce artifacts that has previously succeeded, re-run one of the jobs in the pipeline. Use the latest artifacts URL while the job is running. Even different jobs within pipeline that have artifacts return 404 for latest artifact URLs while the job is running.
Example Project
https://gitlab.com/mergetb/tech/images/blob/master/.gitlab-ci.yml
In particular, the paths used are
https://gitlab.com/mergetb/tech/images/blob/master/debian/buster/minnow.dock#L27-29
What is the current bug behavior?
Latest artifact URLs 404 when a pipeline for the specified ref is running.
What is the expected correct behavior?
Latest artifact URLs should return artifacts to the latest successful pipeline for the specified ref, independent of any pipeline activity that is currently happening.
This bug happens on GitLab.com