Optimization Strategies
Contents
Optimization Strategies¶
Taskgraph provides some built-in strategies that can be used during the optimzation process.
Strategies for Removing Tasks¶
skip-unless-changed¶
Note
This strategy is only implemented for Mercurial repositories hosted on
hg.mozilla.org
.
The skip-unless-changed
strategy will optimize the
target task away unless a specified file is modified. Glob patterns are
supported.
Example:
my-task:
optimization:
skip-unless-changed:
- some/file.txt
- docs/**
Strategies for Replacing Tasks¶
index-search¶
Given a list of index paths, the index-search
strategy will replace the target
task with the first one that exists.
In order for the indexed task to be considered for replacement, it must:
Exist.
Not have a
state
offailed
orexception
.Not expire before the earliest deadline of all tasks depending on it.
Example:
my-task:
optimization:
index-search:
- my.index.route
Composite Strategies¶
These strategies operate on one or more substrategies. Composite strategies may contain other composite strategies.