Bug 1249078 - Support grouping and running tasks by tag; r=garndt

We can now define a list of "tags" for a task. Specifying "-j <tag>"
in Try syntax will run all tasks having that tag.

MozReview-Commit-ID: Ih9Z0tRZ5VA
This commit is contained in:
Gregory Szorc
2016-02-17 11:12:40 -08:00
parent 090c3b118e
commit 3315d1c1f3
2 changed files with 21 additions and 2 deletions

View File

@@ -332,9 +332,23 @@ def parse_commit(message, jobs):
})
# Process miscellaneous tasks.
for name, task in sorted(jobs.get('tasks', {}).items()):
def filtertask(name, task):
# args.jobs == None implies all tasks.
if args.jobs is not None and name not in args.jobs:
if args.jobs is None:
return True
if name in args.jobs:
return True
for tag in task.get('tags', []):
if tag in args.jobs:
return True
return False
for name, task in sorted(jobs.get('tasks', {}).items()):
if not filtertask(name, task):
continue
# TODO support tasks that are defined as dependent on another one.