hey there, thanks for taking the time to look at the code and come up with some options. unfortunately this is not something we would merge, which I will try and explain below.
The first reason is that the go-scm library works fine with subgroups. The problem is not with the go-scm library, the problem is with Drone core. If we were to consider implementing a workaround, it would be in Drone, not in go-scm.
The second reason is this approach (replacing / with -) could have unintended consequences. I would be concerned with repository name collisions which can have security implications. For example, image we have a repository called foo-bar/baz and subgroup foo/bar/baz.
The proposed workaround would also cause issues with displays being incorrect in the user interface, when sending slack notifications (and many other plugins), using the command line utility, etc. While some people may be willing to accept these inconsistencies, other will not, and as the maintainer I will be stuck responding to forum posts and github issues claiming Drone is broken. This is not something I am willing to commit to.
For these reasons, if we are going to support subgroups in Drone, we need proper support as opposed to a workaround.
Thank you for the explanation but I still think we can make subgroups work without major changes in the code.
The first reason is that the go-scm library works fine with subgroups.
I disagree. Consider two repositories: foo/bar/baz and bar/baz.
Currently, go-scm will identify both of them as same because it’s settings namespace using the path property instead of full_path (See repo.go#L175 and Gitlab API)
The second reason is this approach (replacing / with -)
How about I make some more changes to use / as the separator instead of --?
Basically, in case of subgroups, namespace will be everything before repo name. For example: in case of foo/bar/baz, Namespace = foo/bar and RepoName = baz
Do you think that’ll solve all the issues? I’d be happy to work on it.
The ideal solution for foo/bar/baz would be namespace foo and repository bar/baz. It will require significant development effort to get this working because it touches almost every layer of Drone.