Direct Links to Tagged Artifacts Resolve to Latest Tagged Artifact
Summary
Direct URLS to the latest artifacts for a specific tag resolve to a job for the latest tag, not the specified tag.
This conflicts with documentation which states that the direct URLs will resolve to the most recent successful pipeline for the specific ref.
The latest artifacts are created by jobs in the most recent successful pipeline for the specific ref
Steps to reproduce
- Use a .gitlab-ci.yml that creates artifacts in pipelines for new tags (
CI_COMMIT_TAG
is present) - Create multiple tags
- Use a direct URL to one of the artifact files
- Direct URL will resolve to the latest tag even though an older ref was specified
Example Project
I have created the project d0c-s4vage-tests/tag-artifact-error to reproduce this issue.
The .gitlab-ci.yml
for this project is simple - pipelines for new tags create artifacts. Notice how the URLS below each resolve to the same job for the latest tag instead of resolving to the specific job for the tag's own pipeline:
File links
- https://gitlab.com/d0c-s4vage-tests/tag-artifact-error/-/jobs/artifacts/v1.0.0/file/artifact-v1.0.0.txt?job=tag-build
- https://gitlab.com/d0c-s4vage-tests/tag-artifact-error/-/jobs/artifacts/v1.0.1/file/artifact-v1.0.1.txt?job=tag-build
- https://gitlab.com/d0c-s4vage-tests/tag-artifact-error/-/jobs/artifacts/v1.0.2/file/artifact-v1.0.2.txt?job=tag-build
- https://gitlab.com/d0c-s4vage-tests/tag-artifact-error/-/jobs/artifacts/v1.0.3/file/artifact-v1.0.3.txt?job=tag-build
Raw links
- https://gitlab.com/d0c-s4vage-tests/tag-artifact-error/-/jobs/artifacts/v1.0.0/raw/artifact-v1.0.0.txt?job=tag-build
- https://gitlab.com/d0c-s4vage-tests/tag-artifact-error/-/jobs/artifacts/v1.0.1/raw/artifact-v1.0.1.txt?job=tag-build
- https://gitlab.com/d0c-s4vage-tests/tag-artifact-error/-/jobs/artifacts/v1.0.2/raw/artifact-v1.0.2.txt?job=tag-build
- https://gitlab.com/d0c-s4vage-tests/tag-artifact-error/-/jobs/artifacts/v1.0.3/raw/artifact-v1.0.3.txt?job=tag-build
Notice how each of the direct links resolves to job 678823930
. This job is from the v1.0.3 pipeline.
What is the current bug behavior?
Direct urls to artifacts in the latest job for a specific tag resolve to artifacts in a job for the latest tag, not the specified tag.
What is the expected correct behavior?
The artifact's direct URL should be resolved to the specified tag's job, not the latest tag's job.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com