Each sub-task needs IRC notification individually

This commit is contained in:
Simon Sapin 2018-09-24 16:51:37 +02:00
parent 45ab69b996
commit 726ccf3a39
2 changed files with 21 additions and 10 deletions

View file

@ -18,16 +18,25 @@ def main():
# https://tools.taskcluster.net/hooks/project-servo/daily
elif task_for == "daily":
# Unlike when reacting to a GitHub event,
# the commit hash is not known until we clone the repository.
os.environ["GIT_SHA"] = \
subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("utf8").strip()
daily_tasks_setup()
with_rust_nightly()
else:
raise ValueError("Unrecognized $TASK_FOR value: %r", task_for)
def daily_tasks_setup():
# Unlike when reacting to a GitHub event,
# the commit hash is not known until we clone the repository.
os.environ["GIT_SHA"] = \
subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("utf8").strip()
# On failure, notify a few people on IRC
decision.task_name_template = "Servo daily: %s. On failure, ping: SimonSapin, nox, emilio"
decision.routes_for_all_subtasks.append("notify.irc-channel.#servo.on-failed")
decision.scopes_for_all_subtasks.append("queue:route:notify.irc-channel.#servo.on-failed")
build_artifacts_expiry = "1 week"
log_artifacts_expiry = "1 year"
@ -167,7 +176,7 @@ def dockerfile_path(name):
decision = DecisionTask(
project_name="Servo", # Used in task names
task_name_template="Servo: %s",
route_prefix="project.servo.servo",
worker_type="servo-docker-worker",
)

View file

@ -29,12 +29,14 @@ class DecisionTask:
DOCKER_IMAGE_BUILDER_IMAGE = "servobrowser/taskcluster-bootstrap:image-builder@sha256:" \
"0a7d012ce444d62ffb9e7f06f0c52fedc24b68c2060711b313263367f7272d9d"
def __init__(self, project_name, *, route_prefix,
def __init__(self, *, route_prefix, task_name_template="%s",
worker_type="github-worker", docker_image_cache_expiry="1 year"):
self.project_name = project_name
self.task_name_template = task_name_template
self.route_prefix = route_prefix
self.worker_type = worker_type
self.docker_image_cache_expiry = docker_image_cache_expiry
self.routes_for_all_subtasks = []
self.scopes_for_all_subtasks = []
# https://docs.taskcluster.net/docs/reference/workers/docker-worker/docs/features#feature-taskclusterproxy
self.queue_service = taskcluster.Queue(options={"baseUrl": "http://taskcluster/queue/v1/"})
@ -159,13 +161,13 @@ class DecisionTask:
"created": self.from_now_json(""),
"deadline": self.from_now_json("1 day"),
"metadata": {
"name": "%s: %s" % (self.project_name, task_name),
"name": self.task_name_template % task_name,
"description": "",
"owner": task_owner,
"source": task_source,
},
"scopes": scopes or [],
"routes": routes or [],
"scopes": (scopes or []) + self.scopes_for_all_subtasks,
"routes": (routes or []) + self.routes_for_all_subtasks,
"extra": extra or {},
"payload": {
"cache": cache or {},