Download a (sub-)folder from a repository via the Repositories API
Problem to solve
Via the Repositories API it's currently only possible to download the entire repository as a zip file. In some situations, however, it may be desirable to download just a portion (folder) of the repository as a zip file.
Developers and other API users (e.g. installing a package from source).
At the very least, it keeps the functionality of the UI and the API in sync.
If I understand the logic behind the Repositories API correctly,
GET /projects/:id/repository/archive[.format] would have to support a
path parameter for this. If the
path parameter is empty or not given,
archive[.format] contains the whole repo.
Permissions and Security
Permissions should be the same as with the Repositories API, (or the Repository files API, which has the
read_repository scope, which the Repositories API has not, see #28324).
path parameter to Get file archive.
Update: @porsager suggested to support multiple paths (repo sub-folders) below. I would leave it to the one implementing this feature to decide whether this is desirable/doable. Maybe it is best to start out with a single path/folder?
I don't know, but I would expect similar tests as for the existing Get file archive functionality.
What does success look like, and how can we measure that?
It is possible to get a file archive with only the contents of a (sub-)folder of the repository via the API.