Rename CONFIG.task_id() to tree_hash

This commit is contained in:
Simon Sapin 2020-03-20 19:23:07 +01:00
parent fa625a7388
commit 95cd67bb95
2 changed files with 19 additions and 19 deletions

View file

@ -186,7 +186,7 @@ def linux_tidy_unit():
./etc/ci/lockfile_changed.sh ./etc/ci/lockfile_changed.sh
./etc/ci/check_no_panic.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 ./mach check
""") """)
.with_artifacts("/repo/target/doc/docs.bundle") .with_artifacts("/repo/target/doc/docs.bundle")
.find_or_create("docs." + CONFIG.task_id()) .find_or_create("docs." + CONFIG.tree_hash())
) )
def upload_docs(): 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 ( return (
linux_task("Upload docs to GitHub Pages") linux_task("Upload docs to GitHub Pages")
.with_treeherder("Linux x64", "DocUpload") .with_treeherder("Linux x64", "DocUpload")
@ -257,7 +257,7 @@ def macos_unit():
./mach package --dev ./mach package --dev
./etc/ci/lockfile_changed.sh ./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", "python mach package --dev --target aarch64-uwp-windows-msvc --uwp=arm64",
) )
.with_artifacts(appx_artifact(debug=True)) .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", "python mach test-tidy --force-cpp --no-wpt",
) )
.with_artifacts(appx_artifact(debug=True)) .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_artifacts(appx_artifact(debug=False))
.with_max_run_time_minutes(3 * 60) .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") "repo/target/debug/msi/Servo.zip")
) )
if cached: 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: else:
return task.create() return task.create()
@ -386,7 +386,7 @@ def windows_nightly():
"mach upload-nightly windows-msvc --secret-from-taskcluster") "mach upload-nightly windows-msvc --secret-from-taskcluster")
.with_artifacts("repo/target/release/msi/Servo.exe", .with_artifacts("repo/target/release/msi/Servo.exe",
"repo/target/release/msi/Servo.zip") "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", "./mach upload-nightly linux --secret-from-taskcluster",
) )
.with_artifacts("/repo/target/release/servo-tech-demo.tar.gz") .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 build --release",
"./mach package --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", "./mach upload-nightly mac --secret-from-taskcluster",
) )
.with_artifacts("repo/target/release/servo-tech-demo.dmg") .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", " target/release/build/osmesa-src-*/out/src/mapi/shared-glapi/.libs",
])) ]))
.with_artifacts("repo/target.tar.gz") .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") .with_artifacts("/target.tar.gz")
.find_or_create("build.linux_x64%s_release_w_assertions.%s" % ( .find_or_create("build.linux_x64%s_release_w_assertions.%s" % (
index_key_suffix, 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(), platform.replace(" ", "_").lower(),
job_id_prefix.replace("-", "_"), job_id_prefix.replace("-", "_"),
this_chunk, this_chunk,
CONFIG.task_id(), CONFIG.tree_hash(),
)) ))

View file

@ -64,14 +64,14 @@ class Config:
self.default_provisioner_id = "proj-example" self.default_provisioner_id = "proj-example"
def task_id(self): def tree_hash(self):
if not hasattr(self, "_task_id"): if not hasattr(self, "_tree_hash"):
# Use the SHA-1 hash of the git "tree" object rather than the commit. # 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 # A `@bors-servo retry` command creates a new merge commit with a different commit hash
# but with the same tree hash. # but with the same tree hash.
output = subprocess.check_output(["git", "show", "-s", "--format=%T", "HEAD"]) output = subprocess.check_output(["git", "show", "-s", "--format=%T", "HEAD"])
self._task_id = output.decode("utf-8").strip() self._tree_hash = output.decode("utf-8").strip()
return self._task_id return self._tree_hash
def git_sha_is_current_head(self): def git_sha_is_current_head(self):
output = subprocess.check_output(["git", "rev-parse", "HEAD"]) output = subprocess.check_output(["git", "rev-parse", "HEAD"])