Bug 1428912 - Only keep track of job names for seen configs in build_lints. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 09 Jan 2018 07:56:36 +0900
changeset 717431 d1963faa7bb6574d32793f4d2b4c12df807c72d0
parent 717423 edd6bbb034fa43b064dae71230b2dc5d3f4da266
child 717442 a9fd0e1ad3ff8ad392d416cc98263373f2bf9565
child 717459 9ffc41c86c42057a8666c65c5f1eb20b47d42c01
push id94668
push userbmo:mh+mozilla@glandium.org
push dateMon, 08 Jan 2018 23:03:03 +0000
reviewersdustin
bugs1428912
milestone59.0a1
Bug 1428912 - Only keep track of job names for seen configs in build_lints. r?dustin When looking for perfherder data collection duplicates, we currently keep full job objects references, which are then used in case an error occurs, to display the job names of the duplicates. But those job objects are yielded and may be modified by other transforms, and presently, by the time a duplicate is found, the corresponding job object has been modified such that it has no 'name' key anymore, leading to a KeyError exception when trying to display the duplicate error message. So instead of keeping the job objects, which can change, and which we don't have a real use for, just keep the job name.
taskcluster/taskgraph/transforms/build_lints.py
--- a/taskcluster/taskgraph/transforms/build_lints.py
+++ b/taskcluster/taskgraph/transforms/build_lints.py
@@ -46,13 +46,13 @@ def check_mozharness_perfherder_options(
         assert primary_config.startswith('builds/')
 
         key = (platform, primary_config, nightly, options)
 
         if key in seen_configs:
             raise Exception('Non-unique Perfherder data collection for jobs '
                             '%s and %s: set PERFHERDER_EXTRA_OPTIONS in worker '
                             'environment variables or use different mozconfigs'
-                            % (job['name'], seen_configs[key]['name']))
+                            % (job['name'], seen_configs[key]))
 
-        seen_configs[key] = job
+        seen_configs[key] = job['name']
 
         yield job