Bug 1318200 - Populate parameter indicating whether Servo is present; r?dustin
We wish to conditionally schedule Stylo related tasks depending on
whether Servo is vendored in the source checkout. In order to do
this, we add an "have_servo" parameter when obtaining parameters as
part of running the decision logic. The value is determined by
looking for a "servo" directory in the repository root.
MozReview-Commit-ID: E96R6GtqmuJ
--- a/taskcluster/docs/parameters.rst
+++ b/taskcluster/docs/parameters.rst
@@ -64,16 +64,21 @@ Push Information
``moz_build_date``
A formatted timestamp of ``build_date``. Expressed as a string with the following
format: %Y%m%d%H%M%S
Tree Information
----------------
+``have_servo``
+ Whether Servo is available in the commit being processed.
+
+ (This parameter should be populated automatically.)
+
``project``
Another name for what may otherwise be called tree or branch or
repository. This is the unqualified name, such as ``mozilla-central`` or
``cedar``.
``level``
The `SCM level
<https://www.mozilla.org/en-US/about/governance/policies/commit/access-policy/>`_
--- a/taskcluster/taskgraph/decision.py
+++ b/taskcluster/taskgraph/decision.py
@@ -135,16 +135,20 @@ def get_decision_parameters(options):
parameters['owner'] += '@noreply.mozilla.org'
# use the pushdate as build_date if given, else use current time
parameters['build_date'] = parameters['pushdate'] or int(time.time())
# moz_build_date is the build identifier based on build_date
parameters['moz_build_date'] = time.strftime("%Y%m%d%H%M%S",
time.gmtime(parameters['build_date']))
+ # Test for source checkout properties here.
+ parameters['have_servo'] = os.path.exists(
+ os.path.join(options['topsrcdir'], 'servo'))
+
project = parameters['project']
try:
parameters.update(PER_PROJECT_PARAMETERS[project])
except KeyError:
logger.warning("using default project parameters; add {} to "
"PER_PROJECT_PARAMETERS in {} to customize behavior "
"for this project".format(project, __file__))
parameters.update(PER_PROJECT_PARAMETERS['default'])
--- a/taskcluster/taskgraph/parameters.py
+++ b/taskcluster/taskgraph/parameters.py
@@ -10,16 +10,17 @@ import json
import yaml
from mozbuild.util import ReadOnlyDict
# Please keep this list sorted and in sync with taskcluster/docs/parameters.rst
PARAMETER_NAMES = set([
'base_repository',
'build_date',
'filters',
+ 'have_servo',
'head_ref',
'head_repository',
'head_rev',
'level',
'message',
'moz_build_date',
'optimize_target_tasks',
'owner',