From fa6c41c64419bf5a8e5de69db8e5c5ec48889514 Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Fri, 27 Oct 2023 13:33:10 +0200 Subject: [PATCH] new version of bootstrap.patch --- patches/bootstrap.patch | 100 +++++++++++++++++++++++++++++++++++----- release | 2 +- 2 files changed, 90 insertions(+), 12 deletions(-) diff --git a/patches/bootstrap.patch b/patches/bootstrap.patch index 0856351..bfff593 100644 --- a/patches/bootstrap.patch +++ b/patches/bootstrap.patch @@ -39,15 +39,91 @@ # put the kinds into a graph and sort topologically so that kinds are loaded --- a/third_party/python/taskcluster_taskgraph/taskgraph/parameters.py +++ b/third_party/python/taskcluster_taskgraph/taskgraph/parameters.py -@@ -83,9 +83,36 @@ def _get_defaults(repo_root=None): - try: - repo = get_repository(repo_path) - except RuntimeError: -- # Use fake values if no repo is detected. -- repo = Mock(branch="", head_rev="", tool="git") -- repo.get_url.return_value = "" -+ # patches/bootstrap.patch - return our object from here, but -+ # it's possible the mock object would have sufficed. +@@ -87,46 +87,77 @@ def _get_defaults(repo_root=None): + repo = Mock(branch="", head_rev="", tool="git") + repo.get_url.return_value = "" + +- try: +- repo_url = repo.get_url() +- parsed_url = mozilla_repo_urls.parse(repo_url) +- project = parsed_url.repo_name +- except ( +- CalledProcessError, +- mozilla_repo_urls.errors.InvalidRepoUrlError, +- mozilla_repo_urls.errors.UnsupportedPlatformError, +- ): +- repo_url = "" +- project = "" ++ if repo: ++ try: ++ repo_url = repo.get_url() ++ parsed_url = mozilla_repo_urls.parse(repo_url) ++ project = parsed_url.repo_name ++ except ( ++ CalledProcessError, ++ mozilla_repo_urls.errors.InvalidRepoUrlError, ++ mozilla_repo_urls.errors.UnsupportedPlatformError, ++ ): ++ repo_url = "" ++ project = "" + +- return { +- "base_repository": repo_url, +- "base_ref": "", +- "base_rev": "", +- "build_date": int(time.time()), +- "build_number": 1, +- "do_not_optimize": [], +- "enable_always_target": True, +- "existing_tasks": {}, +- "filters": ["target_tasks_method"], +- "head_ref": repo.branch or repo.head_rev, +- "head_repository": repo_url, +- "head_rev": repo.head_rev, +- "head_tag": "", +- "level": "3", +- "moz_build_date": datetime.now().strftime("%Y%m%d%H%M%S"), +- "next_version": None, +- "optimize_strategies": None, +- "optimize_target_tasks": True, +- "owner": "nobody@mozilla.com", +- "project": project, +- "pushdate": int(time.time()), +- "pushlog_id": "0", +- "repository_type": repo.tool, +- "target_tasks_method": "default", +- "tasks_for": "", +- "version": get_version(repo_path), +- } ++ return { ++ "base_repository": repo_url, ++ "base_ref": "", ++ "base_rev": "", ++ "build_date": int(time.time()), ++ "build_number": 1, ++ "do_not_optimize": [], ++ "enable_always_target": True, ++ "existing_tasks": {}, ++ "filters": ["target_tasks_method"], ++ "head_ref": repo.branch or repo.head_rev, ++ "head_repository": repo_url, ++ "head_rev": repo.head_rev, ++ "head_tag": "", ++ "level": "3", ++ "moz_build_date": datetime.now().strftime("%Y%m%d%H%M%S"), ++ "next_version": None, ++ "optimize_strategies": None, ++ "optimize_target_tasks": True, ++ "owner": "nobody@mozilla.com", ++ "project": project, ++ "pushdate": int(time.time()), ++ "pushlog_id": "0", ++ "repository_type": repo.tool, ++ "target_tasks_method": "default", ++ "tasks_for": "", ++ "version": get_version(repo_path), ++ } ++ else: + return { + "base_repository": "SOURCE", + "base_ref": "", @@ -77,8 +153,10 @@ + "version": "", + } - try: - repo_url = repo.get_url() + + defaults_functions = [_get_defaults] + + @@ -193,17 +223,18 @@ return os.path.splitext(os.path.basename(spec))[0] diff --git a/release b/release index 0cfbf08..00750ed 100644 --- a/release +++ b/release @@ -1 +1 @@ -2 +3