What happens when two jobs produce artifacts with conflicting locations?



  • In my GitLab CI log I pipeline with three stages

    1. build creates a distribution
    2. semantic-release which bumps the version
    3. publish

    The problem occurs in publish. Sometimes I see the version unbumped. You can see here that semantic-release has the higher number 148288 and it's running BEFORE build 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 before semantic-release. That means the older artifacts are replaced. What happens if the artifact in semantic-release and build 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.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2