Non-archive artifacts give a 404 when downloaded
#23847 (closed) adds a variety of artifacts to the download dropdown on the pipelines page. Previously, that dropdown only included
However, the download routes and controller assume that only one artifact per job will be downloadable, and when not given a file type it assumes that the artifact is of type
archive. Currently, the frontend does not provide a file type, so whenever there is a request to download an artifact of a different type, the controller cannot find it and returns a 404.
Steps to reproduce
- Find a project that creates non-archive downloadable artifacts in its pipelines. Any security scan will work for this.
- Run a pipeline and make sure it is successful.
- In the pipelines page, click on "download" icon for the new pipeline.
- See that the non-archive artifact is listed in the download options.
- Open the browser's dev tools to the Network tab.
- Click on the non-archive artifact in the download dropdown.
- See that nothing is downloaded, and in the Network tab see that the request returns a 404.
What is the current bug behavior?
Attempting to download a non-archive artifact gives a 404.
What is the expected correct behavior?
Attempting to download a non-archive artifact downloads the artifact.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
The current download route takes a project and a build, and uses the build to find the artifact. To do so, it makes the assumption that only one artifact per job will be downloadable. This is no longer an accurate assumption, which is holding up additional feature work and makes this bug difficult to fix quickly.
It would be better to have routes that use an artifact's database ID to find it. This will allow a job to support any number of downloadable artifacts and will make the finding the artifact less complicated.