Honor download_mode in runner artifact downloads
What does this MR do and why?
The GET /api/v4/jobs/:id/artifacts endpoint did not declare download_mode, so client_requested_download_mode ignored the runner's requested transfer mode. This made an explicit download_mode=direct request fall back to the configured default, even when administrators allowed direct downloads.
This declares the optional download_mode parameter and lets an explicit direct request enable direct delivery for this endpoint. The shared download-mode resolver still enforces allowed_download_modes; requests without the parameter retain the existing behavior. Request specs cover direct mode allowed, direct mode disallowed, and the parameter absent.
References
- Required for gitlab-runner!7300 (merged)
- Relates to #624081 (closed)
- Related design and implementation: !252350 (merged)
- Review comment: gitlab-runner!7300 (comment 2678234098)
Screenshots or screen recordings
Not applicable: this is an API-only change with no visible UI.
How to set up and validate locally
Run the focused request specs:
bin/rspec spec/requests/api/ci/runner/jobs_artifacts_spec.rb -e 'GET /api/v4/jobs/:id/artifacts'MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.