Bug 1352477 - taskgraph ignores run-on-project for fennec-nightlies r=aki

MozReview-Commit-ID: 2cdNTV11gdn

--HG--
extra : rebase_source : c6c8672be923a03a83ee8d833313bcf0d02c789a
This commit is contained in:
Johan Lorenzo 2017-04-03 14:53:08 +02:00
parent 5c60916bf8
commit 530eaa4b4e
4 changed files with 34 additions and 10 deletions

View File

@ -28,6 +28,10 @@ job-template:
default: browser/locales/all-locales
android-api-15-nightly: mobile/locales/l10n-changesets.json
chunks: 6
run-on-projects:
- mozilla-central
- mozilla-aurora
- mozilla-beta
run-time:
by-build-platform:
default: 36000

View File

@ -5,8 +5,7 @@ expires-after: 7 days
deadline-after: 24 hours
run-on-projects:
- try
- mozilla-beta
- mozilla-release
- release
worker-type: aws-provisioner-v1/gecko-symbol-upload
worker:
implementation: docker-worker

View File

@ -23,14 +23,31 @@ def get_method(method):
return _target_task_methods[method]
def filter_on_nightly(task, parameters):
return not task.attributes.get('nightly') or parameters.get('include_nightly')
def filter_for_project(task, parameters):
"""Filter tasks by project. Optionally enable nightlies."""
if task.attributes.get('nightly') and not parameters.get('include_nightly'):
return False
run_on_projects = set(task.attributes.get('run_on_projects', []))
return match_run_on_projects(parameters['project'], run_on_projects)
def filter_upload_symbols(task, parameters):
# Filters out symbols when there are not part of a nightly or a release build
# TODO Remove this too specific filter (bug 1353296)
return '-upload-symbols' not in task.label or \
task.attributes.get('nightly') or \
parameters.get('project') in ('mozilla-beta', 'mozilla-release')
def standard_filter(task, parameters):
return all(
filter_func(task, parameters) for filter_func in
(filter_on_nightly, filter_for_project, filter_upload_symbols)
)
@_target_task('try_option_syntax')
def target_tasks_try_option_syntax(full_task_graph, parameters):
"""Generate a list of target tasks based on try syntax in
@ -86,7 +103,7 @@ def target_tasks_default(full_task_graph, parameters):
via the `run_on_projects` attributes."""
return [l for l, t in full_task_graph.tasks.iteritems()
if filter_for_project(t, parameters)]
if standard_filter(t, parameters)]
@_target_task('ash_tasks')
@ -184,14 +201,16 @@ def target_tasks_code_coverage(full_task_graph, parameters):
@_target_task('nightly_fennec')
def target_tasks_nightly(full_task_graph, parameters):
def target_tasks_nightly_fennec(full_task_graph, parameters):
"""Select the set of tasks required for a nightly build of fennec. The
nightly build process involves a pipeline of builds, signing,
and, eventually, uploading the tasks to balrog."""
def filter(task):
platform = task.attributes.get('build_platform')
if platform in ('android-api-15-nightly', 'android-x86-nightly'):
return task.attributes.get('nightly', False)
if not task.attributes.get('nightly', False):
return False
return filter_for_project(task, parameters)
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t)]
@ -214,7 +233,7 @@ def target_tasks_mozilla_beta(full_task_graph, parameters):
of builds and signing, but does not include beetmover or balrog jobs."""
def filter(task):
if not filter_for_project(task, parameters):
if not standard_filter(task, parameters):
return False
platform = task.attributes.get('build_platform')
if platform in ('linux64-pgo', 'linux-pgo', 'win32-pgo', 'win64-pgo',
@ -248,7 +267,7 @@ def target_tasks_candidates_fennec(full_task_graph, parameters):
"""Select the set of tasks required for a candidates build of fennec. The
nightly build process involves a pipeline of builds, signing,
and, eventually, uploading the tasks to balrog."""
filtered_for_project = target_tasks_nightly(full_task_graph, parameters)
filtered_for_project = target_tasks_nightly_fennec(full_task_graph, parameters)
def filter(task):
if task.kind not in ['balrog']:

View File

@ -79,6 +79,8 @@ l10n_description_schema = Schema({
# Description of the localized task
Required('description'): _by_platform(basestring),
Optional('run-on-projects'): job_description_schema['run-on-projects'],
# task object of the dependent task
Required('dependent-task'): object,
@ -366,7 +368,7 @@ def make_job_description(config, jobs):
'symbol': job['treeherder']['symbol'],
'platform': job['treeherder']['platform'],
},
'run-on-projects': [],
'run-on-projects': job.get('run-on-projects') if job.get('run-on-projects') else [],
}
if job.get('index'):