diff --git a/etc/taskcluster/decision_task.py b/etc/taskcluster/decision_task.py index 0d3a4fbe174..951cebe7afa 100644 --- a/etc/taskcluster/decision_task.py +++ b/etc/taskcluster/decision_task.py @@ -186,7 +186,7 @@ def linux_tidy_unit(): ./etc/ci/lockfile_changed.sh ./etc/ci/check_no_panic.sh """) - .find_or_create("linux_unit." + CONFIG.task_id()) + .find_or_create("linux_unit." + CONFIG.tree_hash()) ) @@ -216,12 +216,12 @@ def linux_docs_check(): ./mach check """) .with_artifacts("/repo/target/doc/docs.bundle") - .find_or_create("docs." + CONFIG.task_id()) + .find_or_create("docs." + CONFIG.tree_hash()) ) def upload_docs(): - docs_build_task_id = decisionlib.Task.find("docs." + CONFIG.task_id()) + docs_build_task_id = decisionlib.Task.find("docs." + CONFIG.tree_hash()) return ( linux_task("Upload docs to GitHub Pages") .with_treeherder("Linux x64", "DocUpload") @@ -257,7 +257,7 @@ def macos_unit(): ./mach package --dev ./etc/ci/lockfile_changed.sh """) - .find_or_create("macos_unit." + CONFIG.task_id()) + .find_or_create("macos_unit." + CONFIG.tree_hash()) ) @@ -302,7 +302,7 @@ def windows_arm64(): "python mach package --dev --target aarch64-uwp-windows-msvc --uwp=arm64", ) .with_artifacts(appx_artifact(debug=True)) - .find_or_create("build.windows_uwp_arm64_dev." + CONFIG.task_id()) + .find_or_create("build.windows_uwp_arm64_dev." + CONFIG.tree_hash()) ) @@ -318,7 +318,7 @@ def windows_uwp_x64(): "python mach test-tidy --force-cpp --no-wpt", ) .with_artifacts(appx_artifact(debug=True)) - .find_or_create("build.windows_uwp_x64_dev." + CONFIG.task_id()) + .find_or_create("build.windows_uwp_x64_dev." + CONFIG.tree_hash()) ) @@ -339,7 +339,7 @@ def uwp_nightly(): ) .with_artifacts(appx_artifact(debug=False)) .with_max_run_time_minutes(3 * 60) - .find_or_create("build.windows_uwp_nightlies." + CONFIG.task_id()) + .find_or_create("build.windows_uwp_nightlies." + CONFIG.tree_hash()) ) @@ -369,7 +369,7 @@ def windows_unit(cached=True): "repo/target/debug/msi/Servo.zip") ) if cached: - return task.find_or_create("build.windows_x64_dev." + CONFIG.task_id()) + return task.find_or_create("build.windows_x64_dev." + CONFIG.tree_hash()) else: return task.create() @@ -386,7 +386,7 @@ def windows_nightly(): "mach upload-nightly windows-msvc --secret-from-taskcluster") .with_artifacts("repo/target/release/msi/Servo.exe", "repo/target/release/msi/Servo.zip") - .find_or_create("build.windows_x64_nightly." + CONFIG.task_id()) + .find_or_create("build.windows_x64_nightly." + CONFIG.tree_hash()) ) @@ -403,7 +403,7 @@ def linux_nightly(): "./mach upload-nightly linux --secret-from-taskcluster", ) .with_artifacts("/repo/target/release/servo-tech-demo.tar.gz") - .find_or_create("build.linux_x64_nightly" + CONFIG.task_id()) + .find_or_create("build.linux_x64_nightly" + CONFIG.tree_hash()) ) @@ -415,7 +415,7 @@ def linux_release(): "./mach build --release", "./mach package --release", ) - .find_or_create("build.linux_x64_release" + CONFIG.task_id()) + .find_or_create("build.linux_x64_release" + CONFIG.tree_hash()) ) @@ -434,7 +434,7 @@ def macos_nightly(): "./mach upload-nightly mac --secret-from-taskcluster", ) .with_artifacts("repo/target/release/servo-tech-demo.dmg") - .find_or_create("build.mac_x64_nightly." + CONFIG.task_id()) + .find_or_create("build.mac_x64_nightly." + CONFIG.tree_hash()) ) @@ -477,7 +477,7 @@ def macos_release_build_with_debug_assertions(priority=None): " target/release/build/osmesa-src-*/out/src/mapi/shared-glapi/.libs", ])) .with_artifacts("repo/target.tar.gz") - .find_or_create("build.macos_x64_release_w_assertions." + CONFIG.task_id()) + .find_or_create("build.macos_x64_release_w_assertions." + CONFIG.tree_hash()) ) @@ -509,7 +509,7 @@ def linux_release_build_with_debug_assertions(layout_2020): .with_artifacts("/target.tar.gz") .find_or_create("build.linux_x64%s_release_w_assertions.%s" % ( index_key_suffix, - CONFIG.task_id(), + CONFIG.tree_hash(), )) ) @@ -659,7 +659,7 @@ def wpt_chunks(platform, make_chunk_task, build_task, total_chunks, processes, platform.replace(" ", "_").lower(), job_id_prefix.replace("-", "_"), this_chunk, - CONFIG.task_id(), + CONFIG.tree_hash(), )) diff --git a/etc/taskcluster/decisionlib.py b/etc/taskcluster/decisionlib.py index 34cc634e5c2..cb899319ea5 100644 --- a/etc/taskcluster/decisionlib.py +++ b/etc/taskcluster/decisionlib.py @@ -64,14 +64,14 @@ class Config: self.default_provisioner_id = "proj-example" - def task_id(self): - if not hasattr(self, "_task_id"): + def tree_hash(self): + if not hasattr(self, "_tree_hash"): # Use the SHA-1 hash of the git "tree" object rather than the commit. # A `@bors-servo retry` command creates a new merge commit with a different commit hash # but with the same tree hash. output = subprocess.check_output(["git", "show", "-s", "--format=%T", "HEAD"]) - self._task_id = output.decode("utf-8").strip() - return self._task_id + self._tree_hash = output.decode("utf-8").strip() + return self._tree_hash def git_sha_is_current_head(self): output = subprocess.check_output(["git", "rev-parse", "HEAD"])