mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Index taskcluster tasks by merge parents if available.
This commit is contained in:
parent
e0c95ed855
commit
0edf865deb
3 changed files with 36 additions and 20 deletions
|
@ -30,10 +30,12 @@ tasks:
|
||||||
- '--login'
|
- '--login'
|
||||||
- '-e'
|
- '-e'
|
||||||
- '-c'
|
- '-c'
|
||||||
|
# A depth of 25 is used to work around `git show` ignoring
|
||||||
|
# any provided format with a depth of 1.
|
||||||
- >-
|
- >-
|
||||||
git init repo &&
|
git init repo &&
|
||||||
cd repo &&
|
cd repo &&
|
||||||
git fetch --depth 1 "$GIT_URL" "$GIT_REF" &&
|
git fetch --depth 25 "$GIT_URL" "$GIT_REF" &&
|
||||||
git reset --hard "$GIT_SHA" &&
|
git reset --hard "$GIT_SHA" &&
|
||||||
python3 etc/taskcluster/decision_task.py
|
python3 etc/taskcluster/decision_task.py
|
||||||
in:
|
in:
|
||||||
|
|
|
@ -17,6 +17,8 @@ def main(task_for):
|
||||||
)
|
)
|
||||||
|
|
||||||
if task_for == "github-push":
|
if task_for == "github-push":
|
||||||
|
CONFIG.init_task_id()
|
||||||
|
|
||||||
# FIXME https://github.com/servo/servo/issues/22325 implement these:
|
# FIXME https://github.com/servo/servo/issues/22325 implement these:
|
||||||
linux_arm32_dev = linux_arm64_dev = lambda: None
|
linux_arm32_dev = linux_arm64_dev = lambda: None
|
||||||
|
|
||||||
|
@ -193,12 +195,12 @@ def linux_tidy_unit_docs():
|
||||||
git bundle create docs.bundle HEAD
|
git bundle create docs.bundle HEAD
|
||||||
""")
|
""")
|
||||||
.with_artifacts("/repo/target/doc/docs.bundle")
|
.with_artifacts("/repo/target/doc/docs.bundle")
|
||||||
.find_or_create("docs." + CONFIG.git_sha)
|
.find_or_create("docs." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def upload_docs():
|
def upload_docs():
|
||||||
docs_build_task_id = decisionlib.Task.find("docs." + CONFIG.git_sha)
|
docs_build_task_id = decisionlib.Task.find("docs." + CONFIG.task_id)
|
||||||
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")
|
||||||
|
@ -233,7 +235,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.git_sha)
|
.find_or_create("macos_unit." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -266,7 +268,7 @@ def android_arm32_dev_from_macos():
|
||||||
./mach bootstrap-android --accept-all-licences --build
|
./mach bootstrap-android --accept-all-licences --build
|
||||||
./mach build --android --dev --verbose
|
./mach build --android --dev --verbose
|
||||||
""")
|
""")
|
||||||
.find_or_create("android_arm32_dev.macos." + CONFIG.git_sha)
|
.find_or_create("android_arm32_dev.macos." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -279,7 +281,7 @@ def android_arm32_dev():
|
||||||
./etc/ci/lockfile_changed.sh
|
./etc/ci/lockfile_changed.sh
|
||||||
python ./etc/ci/check_dynamic_symbols.py
|
python ./etc/ci/check_dynamic_symbols.py
|
||||||
""")
|
""")
|
||||||
.find_or_create("android_arm32_dev." + CONFIG.git_sha)
|
.find_or_create("android_arm32_dev." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -303,7 +305,7 @@ def android_nightly():
|
||||||
"/repo/target/android/i686-linux-android/release/servoapp.apk",
|
"/repo/target/android/i686-linux-android/release/servoapp.apk",
|
||||||
"/repo/target/android/i686-linux-android/release/servoview.aar",
|
"/repo/target/android/i686-linux-android/release/servoview.aar",
|
||||||
)
|
)
|
||||||
.find_or_create("build.android_nightlies." + CONFIG.git_sha)
|
.find_or_create("build.android_nightlies." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -316,7 +318,7 @@ def android_arm32_release():
|
||||||
"/repo/target/android/armv7-linux-androideabi/release/servoapp.apk",
|
"/repo/target/android/armv7-linux-androideabi/release/servoapp.apk",
|
||||||
"/repo/target/android/armv7-linux-androideabi/release/servoview.aar",
|
"/repo/target/android/armv7-linux-androideabi/release/servoview.aar",
|
||||||
)
|
)
|
||||||
.find_or_create("build.android_armv7_release." + CONFIG.git_sha)
|
.find_or_create("build.android_armv7_release." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -329,7 +331,7 @@ def android_x86_release():
|
||||||
"/repo/target/android/i686-linux-android/release/servoapp.apk",
|
"/repo/target/android/i686-linux-android/release/servoapp.apk",
|
||||||
"/repo/target/android/i686-linux-android/release/servoview.aar",
|
"/repo/target/android/i686-linux-android/release/servoview.aar",
|
||||||
)
|
)
|
||||||
.find_or_create("build.android_x86_release." + CONFIG.git_sha)
|
.find_or_create("build.android_x86_release." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -352,7 +354,7 @@ def android_x86_wpt():
|
||||||
/_mozilla/mozilla/DOMParser.html \
|
/_mozilla/mozilla/DOMParser.html \
|
||||||
/_mozilla/mozilla/webgl/context_creation_error.html
|
/_mozilla/mozilla/webgl/context_creation_error.html
|
||||||
""")
|
""")
|
||||||
.find_or_create("android_x86_release." + CONFIG.git_sha)
|
.find_or_create("android_x86_release." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -366,7 +368,7 @@ def windows_x86():
|
||||||
.with_script(
|
.with_script(
|
||||||
"python mach build --dev --target i686-pc-windows-msvc",
|
"python mach build --dev --target i686-pc-windows-msvc",
|
||||||
)
|
)
|
||||||
.find_or_create("build.windows_x86_dev." + CONFIG.git_sha)
|
.find_or_create("build.windows_x86_dev." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -385,7 +387,7 @@ def windows_unit():
|
||||||
)
|
)
|
||||||
.with_artifacts("repo/target/debug/msi/Servo.exe",
|
.with_artifacts("repo/target/debug/msi/Servo.exe",
|
||||||
"repo/target/debug/msi/Servo.zip")
|
"repo/target/debug/msi/Servo.zip")
|
||||||
.find_or_create("build.windows_x64_dev." + CONFIG.git_sha)
|
.find_or_create("build.windows_x64_dev." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -397,7 +399,7 @@ def windows_release():
|
||||||
"mach package --release")
|
"mach package --release")
|
||||||
.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_release." + CONFIG.git_sha)
|
.find_or_create("build.windows_x64_release." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -413,7 +415,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.git_sha)
|
.find_or_create("build.windows_x64_nightly." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -430,7 +432,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.git_sha)
|
.find_or_create("build.linux_x64_nightly" + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -447,7 +449,7 @@ def linux_wpt():
|
||||||
target/release/build/osmesa-src-*/out/lib/gallium
|
target/release/build/osmesa-src-*/out/lib/gallium
|
||||||
""")
|
""")
|
||||||
.with_artifacts("/target.tar.gz")
|
.with_artifacts("/target.tar.gz")
|
||||||
.find_or_create("build.linux_x64_release~assertions" + CONFIG.git_sha)
|
.find_or_create("build.linux_x64_release~assertions" + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
def linux_run_task(name):
|
def linux_run_task(name):
|
||||||
return linux_task(name).with_dockerfile(dockerfile_path("run"))
|
return linux_task(name).with_dockerfile(dockerfile_path("run"))
|
||||||
|
@ -470,7 +472,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.git_sha)
|
.find_or_create("build.mac_x64_nightly." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -500,7 +502,7 @@ def update_wpt():
|
||||||
./etc/ci/update-wpt-checkout open-pr
|
./etc/ci/update-wpt-checkout open-pr
|
||||||
./etc/ci/update-wpt-checkout cleanup
|
./etc/ci/update-wpt-checkout cleanup
|
||||||
""")
|
""")
|
||||||
.find_or_create("wpt_update." + CONFIG.git_sha)
|
.find_or_create("wpt_update." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -518,7 +520,7 @@ def macos_release_build():
|
||||||
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." + CONFIG.git_sha)
|
.find_or_create("build.macos_x64_release." + CONFIG.task_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -606,7 +608,7 @@ def wpt_chunks(platform, make_chunk_task, build_task, total_chunks, processes,
|
||||||
if word.endswith(".log")
|
if word.endswith(".log")
|
||||||
])
|
])
|
||||||
platform_id = platform.replace(" ", "_").lower()
|
platform_id = platform.replace(" ", "_").lower()
|
||||||
task.find_or_create("%s_wpt_%s.%s" % (platform_id, this_chunk, CONFIG.git_sha))
|
task.find_or_create("%s_wpt_%s.%s" % (platform_id, this_chunk, CONFIG.task_id))
|
||||||
|
|
||||||
|
|
||||||
def daily_tasks_setup():
|
def daily_tasks_setup():
|
||||||
|
|
|
@ -57,9 +57,21 @@ class Config:
|
||||||
self.git_ref = os.environ.get("GIT_REF")
|
self.git_ref = os.environ.get("GIT_REF")
|
||||||
self.git_sha = os.environ.get("GIT_SHA")
|
self.git_sha = os.environ.get("GIT_SHA")
|
||||||
|
|
||||||
|
def init_task_id(self):
|
||||||
|
# If the head commit is a merge, we want to generate a unique task id which incorporates
|
||||||
|
# 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.
|
||||||
|
merge_parents_output = subprocess.check_output(["git", "show", "--format=%P", "HEAD"])
|
||||||
|
merge_parents = merge_parents_output.decode("utf8").strip().split(' ')
|
||||||
|
self.task_id = self.git_sha
|
||||||
|
if len(merge_parents) > 1:
|
||||||
|
self.task_id = '-'.join(merge_parents)
|
||||||
|
|
||||||
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"])
|
||||||
self.git_sha = output.decode("utf8").strip()
|
self.git_sha = output.decode("utf8").strip()
|
||||||
|
self.init_task_id()
|
||||||
|
|
||||||
|
|
||||||
class Shared:
|
class Shared:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue