Bug 1318200 - Introduce task graph filtering; r=dustin

Previously, we ran a single "target task" function to mutate the full
task graph into a subset based on input parameters (try syntax,
repository being built for, etc). This concept is useful. But
the implementation was limiting because we could only have a single
"target tasks" function.

This commit introduces the concept of "filters." They conceptually
do the same thing as "target tasks methods" but you can run more than
1 of them.

Filters are simply functions that examine an input graph+parameters
and emit nodes that should be retained. Filters, like target tasks
methods, are defined via decorated functions in a module.

TaskGraphGenerator has been converted to use filters. The list of
defined filters can be defined in the parameters dict passed into
TaskGraphGenerator. A default filter list is provided in decision.py.

The intent is to eventually convert target tasks to filters. Until
that happens, we always run the registered target tasks method via
a filter proxy function.

No new tests have been added because we don't yet have any
functionality relying explicitly on filters. Tests will be added in
a subsequent commit once we add a new filter.

While I was here, I also snuck in some logging on the size of the
graphs.

MozReview-Commit-ID: ERn2hIYbMRp
This commit is contained in:
Gregory Szorc
2016-11-17 15:53:30 -08:00
parent 49ecc723ac
commit 5d56d07832
6 changed files with 69 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ from mozbuild.util import ReadOnlyDict
PARAMETER_NAMES = set([
'base_repository',
'build_date',
'filters',
'head_ref',
'head_repository',
'head_rev',