Bug 1386857 - [taskgraph] Add path of offending config file to the UNKNOWN_GROUP_NAME error message, r=dustin
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 12 Jan 2018 15:49:27 -0500
changeset 454042 f924db10f84f5b10536651002965ebcefb3b8a72
parent 454041 ff483bbeacaf72aff8e6ec6e227dafdcdce11825
child 454043 47cfae837c499c0dcf95c646114f1b4ee129d7ad
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1386857
milestone59.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 1386857 - [taskgraph] Add path of offending config file to the UNKNOWN_GROUP_NAME error message, r=dustin When trying to remove an ubiquitous group like tc(), it's hard to tell where the error was located without grepping my filesystem. This makes it a bit easier to find and fix these errors. MozReview-Commit-ID: 8NjvB5zOoqb
taskcluster/taskgraph/transforms/task.py
taskcluster/taskgraph/transforms/tests.py
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -584,17 +584,18 @@ task_description_schema = Schema({
         Optional('rollout-percentage'): Any(int, None),
     }),
 })
 
 TC_TREEHERDER_SCHEMA_URL = 'https://github.com/taskcluster/taskcluster-treeherder/' \
                            'blob/master/schemas/task-treeherder-config.yml'
 
 
-UNKNOWN_GROUP_NAME = "Treeherder group {} has no name; add it to taskcluster/ci/config.yml"
+UNKNOWN_GROUP_NAME = "Treeherder group {} (from {}) has no name; " \
+                     "add it to taskcluster/ci/config.yml"
 
 V2_ROUTE_TEMPLATES = [
     "index.{trust-domain}.v2.{project}.latest.{product}.{job-name}",
     "index.{trust-domain}.v2.{project}.pushdate.{build_date_long}.{product}.{job-name}",
     "index.{trust-domain}.v2.{project}.pushlog-id.{pushlog_id}.{product}.{job-name}",
     "index.{trust-domain}.v2.{project}.revision.{head_rev}.{product}.{job-name}",
 ]
 
@@ -1391,17 +1392,18 @@ def build_task(config, tasks):
             treeherder['machine'] = {'platform': machine_platform}
             treeherder['collection'] = {collection: True}
 
             group_names = config.graph_config['treeherder']['group-names']
             groupSymbol, symbol = split_symbol(task_th['symbol'])
             if groupSymbol != '?':
                 treeherder['groupSymbol'] = groupSymbol
                 if groupSymbol not in group_names:
-                    raise Exception(UNKNOWN_GROUP_NAME.format(groupSymbol))
+                    path = os.path.join(config.path, task.get('job-from', ''))
+                    raise Exception(UNKNOWN_GROUP_NAME.format(groupSymbol, path))
                 treeherder['groupName'] = group_names[groupSymbol]
             treeherder['symbol'] = symbol
             if len(symbol) > 25 or len(groupSymbol) > 25:
                 raise RuntimeError("Treeherder group and symbol names must not be longer than "
                                    "25 characters: {} (see {})".format(
                                        task_th['symbol'],
                                        TC_TREEHERDER_SCHEMA_URL,
                                        ))
--- a/taskcluster/taskgraph/transforms/tests.py
+++ b/taskcluster/taskgraph/transforms/tests.py
@@ -976,16 +976,17 @@ def make_job_description(config, tests):
 
         jobdesc = {}
         name = '{}-{}'.format(test['test-platform'], test['test-name'])
         jobdesc['name'] = name
         jobdesc['label'] = label
         jobdesc['description'] = test['description']
         jobdesc['attributes'] = attributes
         jobdesc['dependencies'] = {'build': build_label}
+        jobdesc['job-from'] = test['job-from']
 
         if test['mozharness']['requires-signed-builds'] is True:
             jobdesc['dependencies']['build-signing'] = test['build-signing-label']
 
         jobdesc['expires-after'] = test['expires-after']
         jobdesc['routes'] = []
         jobdesc['run-on-projects'] = test['run-on-projects']
         jobdesc['scopes'] = []