build_manifest.py: Use the project path not the name
authorJordan Petridis <jordan@centricular.com>
Tue, 23 Oct 2018 20:14:17 +0000 (23:14 +0300)
committerJordan Petridis <jordan@centricular.com>
Mon, 5 Nov 2018 09:24:12 +0000 (11:24 +0200)
The project path is what's shown in the url bar, ex
gitlab.example.com/john/gstreamer -> path == gstreamer

The project name is defined in project settings and its just.
Its more common to change the name of a fork than its path.

gitlab/build_manifest.py

index dda8266..11de839 100755 (executable)
@@ -68,12 +68,12 @@ def find_repository_sha(module: str, branchname: str) -> Tuple[str, str]:
             continue
 
         id = project['id']
-        if project['namespace']['name'] in useful_namespaces:
-            if project['namespace']['name'] == user_namespace:
+        if project['namespace']['path'] in useful_namespaces:
+            if project['namespace']['path'] == user_namespace:
                 # If we have a branch with same name, use it.
                 for branch in request(f"{id}/repository/branches"):
                     if branch['name'] == branchname:
-                        name = project['namespace']['name']
+                        name = project['namespace']['path']
                         print(f"{name}/{branchname}")
 
                         return 'user', branch['commit']['id']