Bug 1333531 - chunkify.chunkify breaks if less locales are in all-locales than chunks in decision task. r=aki a=gchang
authorJustin Wood <Callek@gmail.com>
Fri, 27 Jan 2017 15:47:30 -0500
changeset 378211 e9ebff9c36960e9ffb4407ba073ef28a8a8f665b
parent 378210 098f633018d5b6e0843fdecd94cb2042706963fd
child 378212 d4910d723a36c7e49c0a40f0015603aa4c02b8dd
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki, gchang
bugs1333531
milestone53.0a2
Bug 1333531 - chunkify.chunkify breaks if less locales are in all-locales than chunks in decision task. r=aki a=gchang MozReview-Commit-ID: Hr7KgyHIMlc
taskcluster/taskgraph/transforms/l10n.py
--- a/taskcluster/taskgraph/transforms/l10n.py
+++ b/taskcluster/taskgraph/transforms/l10n.py
@@ -243,16 +243,19 @@ def all_locales_attribute(config, jobs):
 
 @transforms.add
 def chunk_locales(config, jobs):
     """ Utilizes chunking for l10n stuff """
     for job in jobs:
         chunks = job.get('chunks')
         all_locales = job['attributes']['all_locales']
         if chunks:
+            if chunks > len(all_locales):
+                # Reduce chunks down to the number of locales
+                chunks = len(all_locales)
             for this_chunk in range(1, chunks + 1):
                 chunked = copy.deepcopy(job)
                 chunked['name'] = chunked['name'].replace(
                     '/', '-{}/'.format(this_chunk), 1
                 )
                 chunked['mozharness']['options'] = chunked['mozharness'].get('options', [])
                 my_locales = []
                 my_locales = chunkify(all_locales, this_chunk, chunks)