Skip to content

Commit

Permalink
Bug 1364266 - Specify task priority within task definition r=dustin a…
Browse files Browse the repository at this point in the history
…=merge

Tasks should be assigned a priority based on the branch they originated from. It
is important that certain branches receive preferential treatment, such as a release
branch task being executed before a task from Try. Branch priority mirrors
the priorities defined within buildbot.

MozReview-Commit-ID: 8qR9F34lzzc

--HG--
extra : source : 6a2176a264959e19e4a4cbcb18fd47b9653745f8
  • Loading branch information
Gregory Arndt committed May 5, 2017
1 parent 0174ce8 commit 4604c92
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions taskcluster/taskgraph/transforms/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,42 @@

COALESCE_KEY = 'builds.{project}.{name}'

DEFAULT_BRANCH_PRIORITY = 'low'
BRANCH_PRIORITIES = {
'mozilla-release': 'highest',
'comm-esr45': 'highest',
'comm-esr52': 'highest',
'mozilla-esr45': 'very-high',
'mozilla-esr52': 'very-high',
'mozilla-beta': 'high',
'comm-beta': 'high',
'mozilla-central': 'medium',
'comm-central': 'medium',
'mozilla-aurora': 'medium',
'comm-aurora': 'medium',
'autoland': 'low',
'mozilla-inbound': 'low',
'try': 'very-low',
'try-comm-central': 'very-low',
'alder': 'very-low',
'ash': 'very-low',
'birch': 'very-low',
'cedar': 'very-low',
'cypress': 'very-low',
'date': 'very-low',
'elm': 'very-low',
'fig': 'very-low',
'gum': 'very-low',
'holly': 'very-low',
'jamun': 'very-low',
'larch': 'very-low',
'maple': 'very-low',
'oak': 'very-low',
'pine': 'very-low',
'graphics': 'very-low',
'ux': 'very-low',
}

# define a collection of payload builders, depending on the worker implementation
payload_builders = {}

Expand Down Expand Up @@ -921,6 +957,11 @@ def build_task(config, tasks):
name=task['coalesce-name'])
routes.append('coalesce.v1.' + key)

if 'priority' not in task:
task['priority'] = BRANCH_PRIORITIES.get(
config.params['project'],
DEFAULT_BRANCH_PRIORITY)

tags = task.get('tags', {})
tags.update({'createdForUser': config.params['owner']})

Expand All @@ -943,6 +984,7 @@ def build_task(config, tasks):
},
'extra': extra,
'tags': tags,
'priority': task['priority'],
}

if task_th:
Expand Down

0 comments on commit 4604c92

Please sign in to comment.