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

--HG--
extra : rebase_source : 5d8bab98c2793ff3b71e36e7a4d14dca60bba46c
This commit is contained in:
Gregory Szorc 2016-02-17 11:12:40 -08:00
Родитель 349574a271
Коммит f64a2d0b31
2 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -175,6 +175,11 @@ when
*optional* Dictionary of conditions that must be met for this task
to run. See the section below for more details.
tags
*optional* List of string labels attached to the task. Multiple tasks
with the same tag can all be scheduled at once by specifying the tag
with the ``-j <tag>`` try syntax.
Conditional Execution
---------------------

Просмотреть файл

@ -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.