mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +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
|
@ -119,6 +119,7 @@ class Task:
|
|||
self.scopes = []
|
||||
self.routes = []
|
||||
self.extra = {}
|
||||
self.treeherder_required = False
|
||||
|
||||
# All `with_*` methods return `self`, so multiple method calls can be chained.
|
||||
with_description = chaining(setattr, "description")
|
||||
|
@ -135,6 +136,10 @@ class Task:
|
|||
|
||||
with_extra = chaining(update_attr, "extra")
|
||||
|
||||
def with_treeherder_required(self):
|
||||
self.treeherder_required = True
|
||||
return self
|
||||
|
||||
def with_treeherder(self, category, symbol=None):
|
||||
symbol = symbol or self.name
|
||||
assert len(symbol) <= 25, symbol
|
||||
|
@ -164,6 +169,7 @@ class Task:
|
|||
"tc-treeherder-staging" + suffix,
|
||||
)
|
||||
|
||||
self.treeherder_required = False # Taken care of
|
||||
return self
|
||||
|
||||
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>
|
||||
"""
|
||||
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.task_owner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue