From: Thibault Saunier Date: Wed, 14 Nov 2018 13:16:39 +0000 (-0300) Subject: build_manifest: Never use users 'master' branch for repos we are not explicitely... X-Git-Tag: 1.19.3~497^2~518 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10ae6d0326e9d3198e479e4a7444ce7c4b158ddd;p=platform%2Fupstream%2Fgstreamer.git build_manifest: Never use users 'master' branch for repos we are not explicitely building People very often do not update them leading to random and weird failures --- diff --git a/gitlab/build_manifest.py b/gitlab/build_manifest.py index 01e1b7d..dad5263 100755 --- a/gitlab/build_manifest.py +++ b/gitlab/build_manifest.py @@ -190,20 +190,21 @@ def find_repository_sha(module: Tuple[str, int], branchname: str) -> Tuple[str, if module[0] == os.environ['CI_PROJECT_NAME']: return 'user', os.environ['CI_COMMIT_SHA'] - project = search_user_namespace(namespace, module[0]) - # Find a fork in the User's namespace - if project: - id = project['id'] - print(f"User project found, id: {id}") - # If we have a branch with same name, use it. - branch = get_project_branch(id, branchname) - if branch is not None: - path = project['namespace']['path'] - print("Found mathcing branch in user's namespace") - print(f"{path}/{branchname}") - - return 'user', branch['commit']['id'] - print(f"Did not found user branch named {branchname}") + if branchname != "master": + project = search_user_namespace(namespace, module[0]) + # Find a fork in the User's namespace + if project: + id = project['id'] + print(f"User project found, id: {id}") + # If we have a branch with same name, use it. + branch = get_project_branch(id, branchname) + if branch is not None: + path = project['namespace']['path'] + print("Found matching branch in user's namespace") + print(f"{path}/{branchname}") + + return 'user', branch['commit']['id'] + print(f"Did not find user branch named {branchname}") # Check upstream project for a branch branch = get_project_branch(module[1], branchname)