build_manifest.py: Use the project path not the name

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.
This commit is contained in:
Jordan Petridis 2018-10-23 23:14:17 +03:00
parent 61c5d7b6cf
commit 7ede52d7c7
No known key found for this signature in database
GPG key ID: 902CC06D159744F5

View file

@ -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']