Bug 1531592: [taskgraph] Ensure that treeherder platform has the correct format; r=dustin
authorTom Prince <mozilla@hocat.ca>
Fri, 01 Mar 2019 19:44:29 +0000
changeset 519868 02dec1fe0aca13a3e4bbbace8100d3cdabce7f6f
parent 519867 7e2fced298cb76c55a36145780fb821ab1419cec
child 519869 691151398b918fc80727c8bdd77ad75c478f4a3d
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1531592
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531592: [taskgraph] Ensure that treeherder platform has the correct format; r=dustin A recent change caused the treeherder platform for several jobs to have an extra `/` in it. This add a check to ensure that the platform is formatted correctly, and fixes the tasks with the incorrect format. Differential Revision: https://phabricator.services.mozilla.com/D21650
taskcluster/taskgraph/transforms/repackage.py
taskcluster/taskgraph/transforms/repackage_signing.py
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/taskgraph/transforms/repackage.py
+++ b/taskcluster/taskgraph/transforms/repackage.py
@@ -218,17 +218,17 @@ def make_job_description(config, jobs):
             attributes['locale'] = locale
 
         treeherder = job.get('treeherder', {})
         if attributes.get('nightly'):
             treeherder.setdefault('symbol', 'Nr')
         else:
             treeherder.setdefault('symbol', 'Rpk')
         dep_th_platform = dep_job.task.get('extra', {}).get('treeherder-platform')
-        treeherder.setdefault('platform', "{}/opt".format(dep_th_platform))
+        treeherder.setdefault('platform', dep_th_platform)
         treeherder.setdefault('tier', 1)
         treeherder.setdefault('kind', 'build')
 
         if config.kind == 'repackage-msi':
             treeherder['symbol'] = 'MSI({})'.format(locale or 'N')
 
         build_task = None
         signing_task = None
--- a/taskcluster/taskgraph/transforms/repackage_signing.py
+++ b/taskcluster/taskgraph/transforms/repackage_signing.py
@@ -47,18 +47,17 @@ def make_repackage_signing_description(c
         attributes['repackage_type'] = 'repackage-signing'
 
         treeherder = job.get('treeherder', {})
         if attributes.get('nightly'):
             treeherder.setdefault('symbol', 'rs(N)')
         else:
             treeherder.setdefault('symbol', 'rs(B)')
         dep_th_platform = dep_job.task.get('extra', {}).get('treeherder-platform')
-        treeherder.setdefault('platform',
-                              "{}/opt".format(dep_th_platform))
+        treeherder.setdefault('platform', dep_th_platform)
         treeherder.setdefault(
             'tier',
             dep_job.task.get('extra', {}).get('treeherder', {}).get('tier', 1)
             )
         treeherder.setdefault('kind', 'build')
 
         if locale:
             treeherder['symbol'] = 'rs({})'.format(locale)
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -31,17 +31,17 @@ from taskgraph.util.schema import (
     taskref_or_string,
 )
 from taskgraph.util.scriptworker import (
     BALROG_ACTIONS,
     get_release_config,
     add_scope_prefix,
 )
 from taskgraph.util.signed_artifacts import get_signed_artifacts
-from voluptuous import Any, Required, Optional, Extra
+from voluptuous import Any, Required, Optional, Extra, Match
 from taskgraph import GECKO, MAX_DEPENDENCIES
 from ..util import docker as dockerutil
 
 RUN_TASK = os.path.join(GECKO, 'taskcluster', 'scripts', 'run-task')
 
 
 @memoize
 def _run_task_suffix():
@@ -104,17 +104,17 @@ task_description_schema = Schema({
         'kind': Any('build', 'test', 'other'),
 
         # tier for this task
         'tier': int,
 
         # task platform, in the form platform/collection, used to set
         # treeherder.machine.platform and treeherder.collection or
         # treeherder.labels
-        'platform': basestring,
+        'platform': Match('^[A-Za-z0-9_-]{1,50}/[A-Za-z0-9_-]{1,50}$'),
     },
 
     # information for indexing this build so its artifacts can be discovered;
     # if omitted, the build will not be indexed.
     Optional('index'): {
         # the name of the product this build produces
         'product': basestring,