Bug 1458700: [release-promotion] Add shipping-product list to graph config; r=aki

Differential Revision: https://phabricator.services.mozilla.com/D1111
This commit is contained in:
Tom Prince
2018-04-19 09:21:30 -06:00
parent fab5574ed3
commit c9c6781559
3 changed files with 25 additions and 5 deletions

View File

@@ -169,9 +169,7 @@ task_description_schema = Schema({
# release promotion product that this task belongs to.
Required('shipping-product'): Any(
None,
'devedition',
'fennec',
'firefox',
basestring
),
# Coalescing provides the facility for tasks to be superseded by the same
@@ -678,7 +676,7 @@ def superseder_url(config, task):
)
UNSUPPORTED_PRODUCT_ERROR = """\
UNSUPPORTED_INDEX_PRODUCT_ERROR = """\
The gecko-v2 product {product} is not in the list of configured products in
`taskcluster/ci/config.yml'.
"""
@@ -687,7 +685,7 @@ The gecko-v2 product {product} is not in the list of configured products in
def verify_index(config, index):
product = index['product']
if product not in config.graph_config['index']['products']:
raise Exception(UNSUPPORTED_PRODUCT_ERROR.format(product=product))
raise Exception(UNSUPPORTED_INDEX_PRODUCT_ERROR.format(product=product))
@payload_builder('docker-worker')
@@ -1240,12 +1238,25 @@ def task_name_from_label(config, tasks):
yield task
UNSUPPORTED_SHIPPING_PRODUCT_ERROR = """\
The shipping product {product} is not in the list of configured products in
`taskcluster/ci/config.yml'.
"""
def validate_shipping_product(config, product):
if product not in config.graph_config['release-promotion']['products']:
raise Exception(UNSUPPORTED_SHIPPING_PRODUCT_ERROR.format(product=product))
@transforms.add
def validate(config, tasks):
for task in tasks:
validate_schema(
task_description_schema, task,
"In task {!r}:".format(task.get('label', '?no-label?')))
if task['shipping-product'] is not None:
validate_shipping_product(config, task['shipping-product'])
yield task