Commit d8ebbea1 authored by Thibault Saunier's avatar Thibault Saunier 🌵

build_manifest: Make sure to respect GitLab currently built SHA

parent 12d067f2
......@@ -186,8 +186,11 @@ def test_search_user_namespace():
def find_repository_sha(module: Tuple[str, int], branchname: str) -> Tuple[str, str]:
namespace: str = os.environ["CI_PROJECT_NAMESPACE"]
project = search_user_namespace(namespace, module[0])
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']
......@@ -243,6 +246,13 @@ def test_find_repository_sha():
# This is now the sha of the last commit
# assert git_ref == "master"
os.environ["CI_PROJECT_NAME"] = "the_project"
os.environ["CI_COMMIT_SHA"] = "MySha"
remote, git_ref = find_repository_sha(("the_project", 199), "whatever")
assert remote == "user"
assert git_ref == "MySha"
if __name__ == "__main__":
parser = argparse.ArgumentParser()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment