The artifacts are not found in the pipeline if they are created in the merge request pipeline

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

When artifacts are created in the job running on the merge request, they are not available using needs: keyword on the pipeline running where merge request is merged to master

Steps to reproduce

  • create project
  • create .gitlab-ci.yml file containing two jobs - one is running on the merge requests only, second one is running on the master branch only and it needs the artifacts from the merge request job running on the merge request mentioned earlier.

Example Project

https://gitlab.com/kpazdera/pipeline-artifacts

What is the current bug behavior?

The artifacts generated by the first pipeline are not available in the second pipeline, the error is:

This job depends on other jobs with expired/erased artifacts:
Please refer to https://docs.gitlab.com/ce/ci/yaml/README.html#dependencies

https://gitlab.com/kpazdera/pipeline-artifacts/-/jobs/790014043

What is the expected correct behavior?

The artifacts should be available

Relevant logs and/or screenshots

https://gitlab.com/kpazdera/pipeline-artifacts/-/jobs/790014043

Output of checks

Results of GitLab environment info

Gitlab Enterprise 12.10.14

Running on on-premise environment (Sessionm, Inc., a Mastercard company)

Possible fixes

Edited by 🤖 GitLab Bot 🤖