What happens when two jobs produce artifacts with conflicting locations?
-
In my GitLab CI log I pipeline with three stages
build
creates a distributionsemantic-release
which bumps the versionpublish
The problem occurs in
publish
. Sometimes I see the version unbumped. You can see here thatsemantic-release
has the higher number 148288 and it's running BEFOREbuild
which overwriting the files. This means this job results in failure,Downloading artifacts for semantic-release (148288)... Downloading artifacts from coordinator... ok id=148288 responseStatus=200 OK token=xFzfAzW6 Downloading artifacts for build (148285)... Downloading artifacts from coordinator... ok id=148285 responseStatus=200 OK token=zxTTXZoA
But sometimes the same pipeline elsewhere is succeeding,
Downloading artifacts for build (113579)... Downloading artifacts from coordinator... ok id=113579 responseStatus=200 OK token=Cfqjv8bG Downloading artifacts for semantic-release (113665)... Downloading artifacts from coordinator... ok id=113665 responseStatus=200 OK token=GAyN8S9M
Notice on this one the
build
job comes beforesemantic-release
. That means the older artifacts are replaced. What happens if the artifact insemantic-release
andbuild
conflict by path? Is this defined?
-
https://gitlab.com/gitlab-org/gitlab/-/issues/324412
With the bug, basically the rule of thumb is this,
A job can rely on an artifact produced by a previous job only so long as no jobs previous to that one produced the same artifact.
The bug report suggests using https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html to only download specific artifacts.