Bug 1524639: [taskgraph] Add a helper to `Schema` to allow referencing downstream schema entries; r=dustin

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Prince 2019-02-04 22:42:00 +00:00
Родитель 9fff567bdd
Коммит ff1ba692a9
30 изменённых файлов: 4 добавлений и 107 удалений

Просмотреть файл

@ -39,7 +39,7 @@ job-defaults:
# The build_attrs transform defaults to setting a `skip-unlles-schedules'
# optimization based on the task label. The tasks here don't have corresponding
# schedules defined in mozbuild.
optimization: {}
optimization: null
jobs:
firefox-source/opt:

Просмотреть файл

@ -21,10 +21,6 @@ from taskgraph.transforms.task import task_description_schema
from voluptuous import Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
balrog_description_schema = schema.extend({
# unique label to describe this balrog task, defaults to balrog-{dep.label}
Optional('label'): basestring,

Просмотреть файл

@ -114,10 +114,6 @@ UPSTREAM_SOURCE_ARTIFACTS = [
"source.tar.xz.asc",
]
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
transforms = TransformSequence()
beetmover_description_schema = schema.extend({

Просмотреть файл

@ -22,10 +22,6 @@ from voluptuous import Optional, Required
from taskgraph.util.treeherder import replace_group
from taskgraph.transforms.task import task_description_schema
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
beetmover_checksums_description_schema = schema.extend({
Required('depname', default='build'): basestring,
Required('attributes'): {basestring: object},

Просмотреть файл

@ -14,10 +14,6 @@ from taskgraph.util.attributes import copy_attributes_from_dependent_job
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
beetmover_checksums_description_schema = schema.extend({
Required('depname', default='build'): basestring,
Optional('label'): basestring,

Просмотреть файл

@ -37,8 +37,6 @@ _MOZ_UPDATE_CHANNEL_PER_BRANCH = {
'maple': '-nightly-maple',
}
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
beetmover_description_schema = schema.extend({
Required('depname', default='build'): basestring,
Optional('label'): basestring,

Просмотреть файл

@ -17,10 +17,6 @@ from taskgraph.util.scriptworker import (get_beetmover_bucket_scope,
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
beetmover_checksums_description_schema = schema.extend({
Required('depname', default='build'): basestring,
Optional('label'): basestring,

Просмотреть файл

@ -16,15 +16,9 @@ from taskgraph.util.scriptworker import (
get_beetmover_bucket_scope, add_scope_prefix,
get_worker_type_for_scope,
)
from taskgraph.transforms.job import job_description_schema
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
job_description_schema = {str(k): v for k, v in job_description_schema.schema.iteritems()}
beetmover_push_to_release_description_schema = Schema({
Required('name'): basestring,

Просмотреть файл

@ -136,10 +136,6 @@ UPSTREAM_ARTIFACT_SIGNED_MAR_PATHS = [
'target.bz2.complete.mar',
]
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
beetmover_description_schema = schema.extend({
# depname is used in taskref's to identify the taskID of the unsigned things
Required('depname', default='build'): basestring,

Просмотреть файл

@ -35,10 +35,6 @@ import logging
logger = logging.getLogger(__name__)
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
beetmover_description_schema = schema.extend({
# depname is used in taskref's to identify the taskID of the unsigned things
Required('depname', default='build'): basestring,

Просмотреть файл

@ -20,10 +20,6 @@ from taskgraph.util.scriptworker import (generate_beetmover_artifact_map,
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
beetmover_checksums_description_schema = schema.extend({
Required('depname', default='build'): basestring,
Optional('label'): basestring,

Просмотреть файл

@ -19,10 +19,6 @@ from taskgraph.util.treeherder import replace_group
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
checksums_signing_description_schema = schema.extend({
Required('depname', default='beetmover'): basestring,
Optional('label'): basestring,

Просмотреть файл

@ -13,10 +13,6 @@ from taskgraph.util.schema import resolve_keyed_by, Schema
from voluptuous import Required
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
google_play_description_schema = Schema({
Required('name'): basestring,
Required('description'): task_description_schema['description'],

Просмотреть файл

@ -33,10 +33,6 @@ from voluptuous import (
logger = logging.getLogger(__name__)
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
# Schema for a build description
job_description_schema = Schema({
# The name of the job and the job's label. At least one must be specified,

Просмотреть файл

@ -39,8 +39,6 @@ def get_variant(test_platform):
return ''
test_description_schema = {str(k): v for k, v in test_description_schema.schema.iteritems()}
mozharness_test_run_schema = Schema({
Required('using'): 'mozharness-test',
Required('test'): test_description_schema,

Просмотреть файл

@ -36,11 +36,6 @@ def _by_platform(arg):
return optionally_keyed_by('build-platform', arg)
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
job_description_schema = {str(k): v for k, v in job_description_schema.schema.iteritems()}
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
l10n_description_schema = schema.extend({
# Name for this job, inferred from the dependent job before validation
Required('name'): basestring,

Просмотреть файл

@ -17,10 +17,6 @@ from taskgraph.util.taskcluster import get_artifact_prefix
from voluptuous import Optional, Required
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
push_apk_description_schema = Schema({
Required('dependent-tasks'): object,

Просмотреть файл

@ -24,9 +24,6 @@ import copy
logger = logging.getLogger(__name__)
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
transforms = TransformSequence()

Просмотреть файл

@ -37,10 +37,6 @@ CHECKSUMS_SIGNING_ARTIFACTS = [
]
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
release_generate_checksums_beetmover_schema = schema.extend({
# depname is used in taskref's to identify the taskID of the unsigned things
Required('depname', default='build'): basestring,

Просмотреть файл

@ -19,10 +19,6 @@ from taskgraph.util.taskcluster import get_artifact_path
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
release_generate_checksums_signing_schema = schema.extend({
Required('depname', default='release-generate-checksums'): basestring,
Optional('label'): basestring,

Просмотреть файл

@ -14,8 +14,6 @@ from taskgraph.util.schema import resolve_keyed_by, optionally_keyed_by
from taskgraph.transforms.task import task_description_schema
from voluptuous import Any, Required
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
transforms = TransformSequence()
langpack_sign_push_description_schema = schema.extend({

Просмотреть файл

@ -13,10 +13,6 @@ from taskgraph.util.schema import optionally_keyed_by, resolve_keyed_by, Schema
from voluptuous import Optional, Required
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
push_snap_description_schema = Schema({
Required('name'): basestring,
Required('job-from'): task_description_schema['job-from'],

Просмотреть файл

@ -22,10 +22,6 @@ from taskgraph.util.workertypes import worker_type_implementation
from taskgraph.transforms.job import job_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
job_description_schema = {str(k): v for k, v in job_description_schema.schema.iteritems()}
packaging_description_schema = schema.extend({
# depname is used in taskref's to identify the taskID of the signed things

Просмотреть файл

@ -24,10 +24,6 @@ from taskgraph.transforms.task import task_description_schema
from taskgraph.transforms.repackage import PACKAGE_FORMATS
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
def _by_platform(arg):
return optionally_keyed_by('build-platform', arg)

Просмотреть файл

@ -20,10 +20,6 @@ from taskgraph.util.scriptworker import (
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
repackage_signing_description_schema = schema.extend({
Required('depname', default='repackage'): basestring,
Optional('label'): basestring,

Просмотреть файл

@ -20,10 +20,6 @@ from taskgraph.util.taskcluster import get_artifact_path
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
transforms = TransformSequence()
repackage_signing_description_schema = schema.extend({

Просмотреть файл

@ -20,10 +20,6 @@ from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
transforms = TransformSequence()
signing_description_schema = schema.extend({

Просмотреть файл

@ -18,10 +18,6 @@ from taskgraph.util.scriptworker import (
from taskgraph.transforms.task import task_description_schema
from voluptuous import Required, Optional
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
checksums_signing_description_schema = schema.extend({
Required('depname', default='beetmover'): basestring,
Optional('label'): basestring,

Просмотреть файл

@ -27,8 +27,6 @@ from voluptuous import (
Schema,
)
job_description_schema = {str(k): v for k, v in job_description_schema.schema.iteritems()}
source_test_description_schema = Schema({
# most fields are passed directly through as job fields, and are not
# repeated here

Просмотреть файл

@ -215,6 +215,9 @@ class Schema(voluptuous.Schema):
schema.__class__ = Schema
return schema
def __getitem__(self, item):
return self.schema[item]
OptimizationSchema = voluptuous.Any(
# always run this task (default)