Bug 1501878 - required_signoffs and signoff_urls parameters r=tomprince

Differential Revision: https://phabricator.services.mozilla.com/D11733

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Aki Sasaki 2018-11-20 21:26:08 +00:00
parent 041b7255f8
commit 33daabf319
4 changed files with 50 additions and 0 deletions

View File

@ -176,6 +176,12 @@ Release Promotion
``release_product``
The product that is being released.
``required_signoffs``
A list of signoffs that are required for this release promotion flavor. If specified, and if the corresponding `signoff_urls` url isn't specified, tasks that require these signoffs will not be scheduled.
``signoff_urls``
A dictionary of signoff keys to url values. These are the urls marking the corresponding ``required_signoffs`` as signed off.
Comm Push Information
---------------------

View File

@ -29,6 +29,9 @@ from taskgraph.parameters import Parameters
from taskgraph.util.attributes import RELEASE_PROMOTION_PROJECTS
RELEASE_PROMOTION_SIGNOFFS = ('mar-signing', )
def is_release_promotion_available(parameters):
return parameters['project'] in RELEASE_PROMOTION_PROJECTS
@ -40,6 +43,27 @@ def get_partner_config(partner_url_config, github_token):
return partner_config
def get_signoff_properties():
props = {}
for signoff in RELEASE_PROMOTION_SIGNOFFS:
props[signoff] = {
'type': 'string',
}
return props
def get_required_signoffs(input, parameters):
input_signoffs = set(input.get('required_signoffs', []))
params_signoffs = set(parameters['required_signoffs'] or [])
return sorted(list(input_signoffs | params_signoffs))
def get_signoff_urls(input, parameters):
signoff_urls = parameters['signoff_urls']
signoff_urls.update(input.get('signoff_urls', {}))
return signoff_urls
def get_flavors(graph_config, param):
"""
Get all flavors with the given parameter enabled.
@ -197,6 +221,19 @@ def get_flavors(graph_config, param):
'default': False,
'description': ('Toggle for creating EME-free repacks'),
},
'required_signoffs': {
'type': 'array',
'description': ('The flavor of release promotion to perform.'),
'items': {
'enum': RELEASE_PROMOTION_SIGNOFFS,
}
},
'signoff_urls': {
'type': 'object',
'default': {},
'additionalProperties': False,
'properties': get_signoff_properties(),
},
},
"required": ['release_promotion_flavor', 'build_number'],
}
@ -308,6 +345,9 @@ def release_promotion_action(parameters, graph_config, input, task_group_id, tas
if input['version']:
parameters['version'] = input['version']
parameters['required_signoffs'] = get_required_signoffs(input, parameters)
parameters['signoff_urls'] = get_signoff_urls(input, parameters)
# make parameters read-only
parameters = Parameters(**parameters)

View File

@ -238,6 +238,8 @@ def get_decision_parameters(config, options):
parameters['release_partner_build_number'] = 1
parameters['release_enable_emefree'] = False
parameters['release_product'] = None
parameters['required_signoffs'] = []
parameters['signoff_urls'] = {}
parameters['try_mode'] = None
parameters['try_task_config'] = None
parameters['try_options'] = None

View File

@ -78,6 +78,8 @@ PARAMETERS = {
'release_partner_build_number': 1,
'release_type': 'nightly',
'release_product': None,
'required_signoffs': [],
'signoff_urls': {},
'target_tasks_method': 'default',
'try_mode': None,
'try_options': None,