You need to sign in or sign up before continuing.
Support path parameter for repository download via API
What does this MR do and why?
This MR adds another parameter to the repository download API (GET /projects/:id/repository/archive[.format]
), path
. Using path
you can restrict the download to only a subfolder of the repository. This is symmetric to the already existing UI feature. Therefore, the implementation was quite easy.
Screenshots or screen recordings
N/A
How to set up and validate locally
- Find the project id with at least one subfolder
- Call or open
https://<GITLAB-URL>/api/v4/projects/<project-id>/repository/archive?path=<subfolder-path>
(use authentication as needed) - The HTTP result will have the
Content-Type: application/octet-stream
header and therefore trigger the download of atar.gz
file - Inside the archive file only the folder given step 2 will be present
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #28827 (closed)