Support for GitLab subgroups
A quick and dirty prototype workaround to address issue #259.
As the install_gitlab seems to not support (yet) subdirectories, the workaround is based on the subdir variable. However in case a repo is inside a subgroup there is a mismatch – subdir corresponds to a repository, and repo to a subgroup (result of the general parsing rules in parse_repo_spec). How about fixing that mismatch with a new dedicated parse_repo_gitlab function?
I am also missing this functionality of installing packages from a path with three levels (not sure if it is a subgroup or subdirectory).
Having tried out this branch I still run into problems.
As far as I can see install_gitlab makes three calls to get the repository in path/to/repo:
- One to get
DESCRIPTION: https://gitlab.foo.com/path/to/repo/raw/master/DESCRIPTION?private_token=token - One to get some metadata about the repo using a URL encoded
path/to/repo: https://gitlab.foo.com/api/v4/projects/path%2Fto%2Frepo/repository/commits/master?private_token=token - One to get the repository as a
tar.gzfile: https://gitlab.foo.com/path/to/repo/repository/archive.tar.gz?ref=master?private_token=token
The first two works for me, but the last one fails.
According to GitLab's documentation the last call should also be different -- using the same form as the second call:
https://gitlab.foo.com/api/v4/projects/path%2Fto%2Frepo/repository/archive.tar.gz?ref=master&private_token=
With this change it works for me. @rozwad : Does this also work for you?
IMHO we should avoid overloading the meaning of subdir (since a subgroup and folder within a repository are different things) and instead consider how to handle sub-directories and sub-groups.
I think it would be better to augment the parser so that there's a way to parse sub-directories and sub-groups separately (either globally or just a GitLab-only parser).