From 794528fc218ac1d7623f78fe92cb8fa2e1b1e37f Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 20 Dec 2019 18:37:17 +0100 Subject: [PATCH 1/2] [Do not merge] Run try on multiple past commits without merging them to current master --- .taskcluster.yml | 2 +- etc/taskcluster/decision_task.py | 32 ++++++++++++++++++++++---------- etc/taskcluster/decisionlib.py | 4 ++-- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.taskcluster.yml b/.taskcluster.yml index b2c277f6f099..1771ad89fc65 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -47,7 +47,7 @@ tasks: - >- git init repo && cd repo && - git fetch --depth 1 "$GIT_URL" "$GIT_REF" && + git fetch "$GIT_URL" "$GIT_REF" && git reset --hard "$GIT_SHA" && python3 etc/taskcluster/decision_task.py in: diff --git a/etc/taskcluster/decision_task.py b/etc/taskcluster/decision_task.py index 7c9b521dac89..6a0b2b85d9e3 100644 --- a/etc/taskcluster/decision_task.py +++ b/etc/taskcluster/decision_task.py @@ -10,7 +10,18 @@ def main(task_for): - with decisionlib.make_repo_bundle(): + decisionlib.Task.with_repo_bundle = lambda s, *args, **kwargs: s.with_repo(*args, *kwargs) + commits = [ + "dcdf910a259005bbdd993089d12f9f7eca9a26db", + "1a31e495a19b364d98b2eae9c2718e098bfc0bde", + ] + CONFIG.initial_git_sha = CONFIG.git_sha + # with decisionlib.make_repo_bundle(): + for CONFIG.git_sha in commits: + CONFIG.task_name_template = "Servo {}: %s".format(CONFIG.git_sha) + CONFIG.scopes_for_all_subtasks + if hasattr(CONFIG, "_task_id"): + del CONFIG._task_id tasks(task_for) @@ -23,7 +34,7 @@ def tasks(task_for): # Work around a tc-github bug/limitation: # https://bugzilla.mozilla.org/show_bug.cgi?id=1548781#c4 - if task_for.startswith("github"): + if task_for.startswith("github") and "statuses" not in CONFIG.routes_for_all_subtasks: # https://github.com/taskcluster/taskcluster/blob/21f257dc8/services/github/config.yml#L14 CONFIG.routes_for_all_subtasks.append("statuses") @@ -95,7 +106,7 @@ def tasks(task_for): # https://github.com/servo/servo/pull/22597#issuecomment-451518810 CONFIG.git_sha_is_current_head() - linux_tidy_unit_untrusted() +# linux_tidy_unit_untrusted() elif task_for == "try-windows-ami": CONFIG.git_sha_is_current_head() @@ -675,7 +686,7 @@ def macos_run_task(name): def linux_wpt(): - linux_wpt_common(total_chunks=4, layout_2020=False) + linux_wpt_common(total_chunks=10, layout_2020=False) def linux_wpt_layout_2020(): @@ -787,12 +798,13 @@ def wpt_chunks(platform, make_chunk_task, build_task, total_chunks, processes, for word in script.split() if word.endswith(".log") ]) - task.find_or_create("%s_%swpt_%s.%s" % ( - platform.replace(" ", "_").lower(), - job_id_prefix.replace("-", "_"), - this_chunk, - CONFIG.task_id(), - )) + task.create() +# task.find_or_create("%s_%swpt_%s.%s" % ( +# platform.replace(" ", "_").lower(), +# job_id_prefix.replace("-", "_"), +# this_chunk, +# CONFIG.task_id(), +# )) def daily_tasks_setup(): diff --git a/etc/taskcluster/decisionlib.py b/etc/taskcluster/decisionlib.py index b8d878da9d88..427b6b028986 100644 --- a/etc/taskcluster/decisionlib.py +++ b/etc/taskcluster/decisionlib.py @@ -71,7 +71,7 @@ def task_id(self): # the merge parents rather that the actual sha of the merge commit. This ensures that tasks # can be reused if the tree is in an identical state. Otherwise, if the head commit is # not a merge, we can rely on the head commit sha for that purpose. - raw_commit = subprocess.check_output(["git", "cat-file", "commit", "HEAD"]) + raw_commit = subprocess.check_output(["git", "cat-file", "commit", CONFIG.git_sha]) parent_commits = [ value.decode("utf8") for line in raw_commit.split(b"\n") @@ -194,7 +194,7 @@ def with_treeherder(self, category, symbol): if CONFIG.treeherder_repository_name: assert CONFIG.git_sha - suffix = ".v2._/%s.%s" % (CONFIG.treeherder_repository_name, CONFIG.git_sha) + suffix = ".v2._/%s.%s" % (CONFIG.treeherder_repository_name, CONFIG.initial_git_sha) self.with_routes( "tc-treeherder" + suffix, "tc-treeherder-staging" + suffix, From 7bf1a5d25b71fd004a3bba3965fbd297480e7296 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 14 Jan 2020 08:25:51 +0100 Subject: [PATCH 2/2] TC: fetch all branches from github.com/servo/servo --- .taskcluster.yml | 3 +-- etc/taskcluster/decision_task.py | 2 +- etc/taskcluster/decisionlib.py | 10 ++++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.taskcluster.yml b/.taskcluster.yml index 1771ad89fc65..537db3a509aa 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -45,9 +45,8 @@ tasks: - '-e' - '-c' - >- - git init repo && + git clone "$GIT_URL" repo && cd repo && - git fetch "$GIT_URL" "$GIT_REF" && git reset --hard "$GIT_SHA" && python3 etc/taskcluster/decision_task.py in: diff --git a/etc/taskcluster/decision_task.py b/etc/taskcluster/decision_task.py index 6a0b2b85d9e3..741f7f1cc2bc 100644 --- a/etc/taskcluster/decision_task.py +++ b/etc/taskcluster/decision_task.py @@ -13,7 +13,7 @@ def main(task_for): decisionlib.Task.with_repo_bundle = lambda s, *args, **kwargs: s.with_repo(*args, *kwargs) commits = [ "dcdf910a259005bbdd993089d12f9f7eca9a26db", - "1a31e495a19b364d98b2eae9c2718e098bfc0bde", + "de610e4d755005376bbd9a4468e24e6c576a3f47", ] CONFIG.initial_git_sha = CONFIG.git_sha # with decisionlib.make_repo_bundle(): diff --git a/etc/taskcluster/decisionlib.py b/etc/taskcluster/decisionlib.py index 427b6b028986..f7ad67e93d1d 100644 --- a/etc/taskcluster/decisionlib.py +++ b/etc/taskcluster/decisionlib.py @@ -511,11 +511,12 @@ def with_repo(self, sparse_checkout=None): type .git\\info\\sparse-checkout """ git += """ - git fetch --no-tags {} {} + git remote add origin {} + git fetch origin git reset --hard {} """.format( assert_truthy(self.git_fetch_url), - assert_truthy(self.git_fetch_ref), + #assert_truthy(self.git_fetch_ref), assert_truthy(self.git_checkout_sha), ) return self \ @@ -647,11 +648,12 @@ def with_repo(self, alternate_object_dir=""): git init repo cd repo echo "{alternate}" > .git/objects/info/alternates - time git fetch --no-tags {} {} + git remote add origin {} + time git fetch origin time git reset --hard {} """.format( assert_truthy(self.git_fetch_url), - assert_truthy(self.git_fetch_ref), + #assert_truthy(self.git_fetch_ref), assert_truthy(self.git_checkout_sha), alternate=alternate_object_dir, ))