remotes icon indicating copy to clipboard operation
remotes copied to clipboard

Support for GitLab subgroups

Open rozwad opened this issue 6 years ago • 2 comments

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?

rozwad avatar Mar 10 '19 01:03 rozwad

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.gz file: 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?

robertdj avatar Jul 04 '19 17:07 robertdj

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).

kevinushey avatar Aug 08 '19 22:08 kevinushey