diff options
Diffstat (limited to 'lorrycontroller/gitlab.py')
-rw-r--r-- | lorrycontroller/gitlab.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lorrycontroller/gitlab.py b/lorrycontroller/gitlab.py index b22bb30..55b8e4f 100644 --- a/lorrycontroller/gitlab.py +++ b/lorrycontroller/gitlab.py @@ -94,6 +94,18 @@ class Gitlab(object): return match.groups()[0] def suitable_path(self, project): + '''Return a path for a downstream Lorry Controller instance to consume. + + Should the path that was lorried have contained more than one level of + namespacing (more than one '/' within the repository path), then for + GitLab to handle this, we replace any '/'s (remaining in the project + name after extracting the group name) with underscores (_). To preserve + the original path, we set the 'original_path' within the project + description. + This method will attempt to return 'original_path' if it was set, + otherwise it will return the 'path_with_namespace', being of the format + 'group_name/project_name', rather than 'group_name/project/name'. + ''' return (self.try_get_original_path(project.description) or project.path_with_namespace) |