gitlabber icon indicating copy to clipboard operation
gitlabber copied to clipboard

Feature request: Add support for personal projects

Open ruurtjan opened this issue 5 years ago • 3 comments

Projects that are in your personal space are currently not taken into account. For individuals using gitlab.com, it would be useful to add those as well. They could either end up in the root directory, or be cloned into a directory with the username, though that might collide with a group with the same name.

ruurtjan avatar May 05 '20 08:05 ruurtjan

The problem gitlabber was trying to solve was complex and large setups with multiple groups where a user was interested in subsets of the large tree.

Personal projects were indeed not taken into account, this functionality can be added relatively easily but like you mentioned some pitfalls need to be considered first.

The ownership model in gitlab is quite complex so let us consider a user john_smith who owns a project projectA which lives under groupA. If we consider the projects api and searching for user projects with the owned=true flag the end results is that projectA will be cloned twice, once under /groupA/projectA and once under /john_smith/projectA I am not sure that this is desirable.

Some users might expect the membership flag to be used in place of owned to clone all projects that they're a member of.

ezbz avatar May 21 '20 06:05 ezbz

ghorg is doing this by a cli switch for either an 'org' or a 'user' clone. I haven't looked into the API calls they are doing to make that work.

liljenstolpe avatar May 22 '20 19:05 liljenstolpe

https://github.com/gabrie30/ghorg/blob/master/vendor/github.com/xanzy/go-gitlab/projects.go#L266

It looks like they're getting users/<user>/projects via go-gitlab

cvockrodt avatar Aug 13 '20 06:08 cvockrodt