mirror of
https://github.com/servo/servo.git
synced 2025-07-31 03:00:29 +01:00
Ensure all tasks started from decision_task.py are on Treeherder.
This commit is contained in:
parent
1ec78c065a
commit
4cd200dd61
2 changed files with 32 additions and 11 deletions
|
@ -5,10 +5,15 @@
|
||||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
from decisionlib import *
|
import decisionlib
|
||||||
|
from decisionlib import CONFIG, SHARED
|
||||||
|
|
||||||
|
|
||||||
def main(task_for):
|
def main(task_for):
|
||||||
|
assert CONFIG.git_ref.startswith("refs/heads/")
|
||||||
|
branch = CONFIG.git_ref[len("refs/heads/"):]
|
||||||
|
CONFIG.treeherder_repository_names.append("servo-" + branch)
|
||||||
|
|
||||||
if task_for == "github-push":
|
if task_for == "github-push":
|
||||||
# FIXME https://github.com/servo/servo/issues/22325 implement these:
|
# FIXME https://github.com/servo/servo/issues/22325 implement these:
|
||||||
macos_wpt = magicleap_dev = linux_arm32_dev = linux_arm64_dev = \
|
macos_wpt = magicleap_dev = linux_arm32_dev = linux_arm64_dev = \
|
||||||
|
@ -56,9 +61,6 @@ def main(task_for):
|
||||||
android_x86_wpt
|
android_x86_wpt
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
assert CONFIG.git_ref.startswith("refs/heads/")
|
|
||||||
branch = CONFIG.git_ref[len("refs/heads/"):]
|
|
||||||
CONFIG.treeherder_repository_names.append("servo-" + branch)
|
|
||||||
for function in by_branch_name.get(branch, []):
|
for function in by_branch_name.get(branch, []):
|
||||||
function()
|
function()
|
||||||
|
|
||||||
|
@ -74,7 +76,7 @@ def mocked_only():
|
||||||
windows_release()
|
windows_release()
|
||||||
linux_wpt()
|
linux_wpt()
|
||||||
android_x86_wpt()
|
android_x86_wpt()
|
||||||
linux_build_task("Indexed by task definition").find_or_create()
|
decisionlib.DockerWorkerTask("Indexed by task definition").find_or_create()
|
||||||
|
|
||||||
|
|
||||||
ping_on_daily_task_failure = "SimonSapin, nox, emilio"
|
ping_on_daily_task_failure = "SimonSapin, nox, emilio"
|
||||||
|
@ -141,7 +143,7 @@ def linux_tidy_unit_docs():
|
||||||
|
|
||||||
|
|
||||||
def upload_docs():
|
def upload_docs():
|
||||||
docs_build_task_id = Task.find("docs." + CONFIG.git_sha)
|
docs_build_task_id = decisionlib.Task.find("docs." + CONFIG.git_sha)
|
||||||
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")
|
||||||
|
@ -187,7 +189,8 @@ def with_rust_nightly():
|
||||||
modified_build_env["RUSTFLAGS"] = " ".join(flags)
|
modified_build_env["RUSTFLAGS"] = " ".join(flags)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
linux_build_task("Linux x64: with Rust Nightly", build_env=modified_build_env)
|
linux_build_task("with Rust Nightly", build_env=modified_build_env)
|
||||||
|
.with_treeherder("Linux x64", "RustNightly")
|
||||||
.with_script("""
|
.with_script("""
|
||||||
echo "nightly" > rust-toolchain
|
echo "nightly" > rust-toolchain
|
||||||
./mach build --dev
|
./mach build --dev
|
||||||
|
@ -239,7 +242,7 @@ def android_x86_release():
|
||||||
def android_x86_wpt():
|
def android_x86_wpt():
|
||||||
build_task = android_x86_release()
|
build_task = android_x86_release()
|
||||||
return (
|
return (
|
||||||
DockerWorkerTask("WPT")
|
linux_task("WPT")
|
||||||
.with_treeherder("Android x86")
|
.with_treeherder("Android x86")
|
||||||
.with_provisioner_id("proj-servo")
|
.with_provisioner_id("proj-servo")
|
||||||
.with_worker_type("docker-worker-kvm")
|
.with_worker_type("docker-worker-kvm")
|
||||||
|
@ -402,18 +405,28 @@ def dockerfile_path(name):
|
||||||
|
|
||||||
|
|
||||||
def linux_task(name):
|
def linux_task(name):
|
||||||
return DockerWorkerTask(name).with_worker_type("servo-docker-worker")
|
return (
|
||||||
|
decisionlib.DockerWorkerTask(name)
|
||||||
|
.with_worker_type("servo-docker-worker")
|
||||||
|
.with_treeherder_required()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def windows_task(name):
|
def windows_task(name):
|
||||||
return WindowsGenericWorkerTask(name).with_worker_type("servo-win2016")
|
return (
|
||||||
|
decisionlib.WindowsGenericWorkerTask(name)
|
||||||
|
.with_worker_type("servo-win2016")
|
||||||
|
.with_treeherder_required()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def macos_task(name):
|
def macos_task(name):
|
||||||
return (
|
return (
|
||||||
MacOsGenericWorkerTask(name)
|
decisionlib.MacOsGenericWorkerTask(name)
|
||||||
.with_provisioner_id("proj-servo")
|
.with_provisioner_id("proj-servo")
|
||||||
.with_worker_type("macos")
|
.with_worker_type("macos")
|
||||||
|
.with_treeherder_required()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@ class Task:
|
||||||
self.scopes = []
|
self.scopes = []
|
||||||
self.routes = []
|
self.routes = []
|
||||||
self.extra = {}
|
self.extra = {}
|
||||||
|
self.treeherder_required = False
|
||||||
|
|
||||||
# All `with_*` methods return `self`, so multiple method calls can be chained.
|
# All `with_*` methods return `self`, so multiple method calls can be chained.
|
||||||
with_description = chaining(setattr, "description")
|
with_description = chaining(setattr, "description")
|
||||||
|
@ -135,6 +136,10 @@ class Task:
|
||||||
|
|
||||||
with_extra = chaining(update_attr, "extra")
|
with_extra = chaining(update_attr, "extra")
|
||||||
|
|
||||||
|
def with_treeherder_required(self):
|
||||||
|
self.treeherder_required = True
|
||||||
|
return self
|
||||||
|
|
||||||
def with_treeherder(self, category, symbol=None):
|
def with_treeherder(self, category, symbol=None):
|
||||||
symbol = symbol or self.name
|
symbol = symbol or self.name
|
||||||
assert len(symbol) <= 25, symbol
|
assert len(symbol) <= 25, symbol
|
||||||
|
@ -164,6 +169,7 @@ class Task:
|
||||||
"tc-treeherder-staging" + suffix,
|
"tc-treeherder-staging" + suffix,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.treeherder_required = False # Taken care of
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def build_worker_payload(self): # pragma: no cover
|
def build_worker_payload(self): # pragma: no cover
|
||||||
|
@ -183,6 +189,8 @@ class Task:
|
||||||
<https://docs.taskcluster.net/docs/reference/platform/taskcluster-queue/references/api#createTask>
|
<https://docs.taskcluster.net/docs/reference/platform/taskcluster-queue/references/api#createTask>
|
||||||
"""
|
"""
|
||||||
worker_payload = self.build_worker_payload()
|
worker_payload = self.build_worker_payload()
|
||||||
|
assert not self.treeherder_required, \
|
||||||
|
"make sure to call with_treeherder() for this task: %s" % self.name
|
||||||
|
|
||||||
assert CONFIG.decision_task_id
|
assert CONFIG.decision_task_id
|
||||||
assert CONFIG.task_owner
|
assert CONFIG.task_owner
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue