Bug 1286075: do not add index routes for jobs; r?mshal draft
authorDustin J. Mitchell <dustin@mozilla.com>
Thu, 04 Aug 2016 21:06:40 +0000
changeset 408059 995a097001f66b8f472c33a354940c62c12d2805
parent 408028 2b0628ccfe96c049a8ca80fd8795b3e023ea52e3
child 408060 ff2a1ae4dca781bf080381cc3187522e294fe0fa
push id28128
push userdmitchell@mozilla.com
push dateWed, 31 Aug 2016 16:24:40 +0000
reviewersmshal
bugs1286075
milestone51.0a1
Bug 1286075: do not add index routes for jobs; r?mshal Jobs, by their nature, do not produce outputs, so they do not need to be indexed. MozReview-Commit-ID: A194OvRVWJi
taskcluster/ci/legacy/tasks/lint.yml
taskcluster/taskgraph/task/legacy.py
--- a/taskcluster/ci/legacy/tasks/lint.yml
+++ b/taskcluster/ci/legacy/tasks/lint.yml
@@ -14,19 +14,16 @@ task:
 
   tags:
     createdForUser: {{owner}}
 
   workerType: b2gtest
   provisionerId: aws-provisioner-v1
   schedulerId: task-graph-scheduler
 
-  routes:
-    - 'index.gecko.v1.{{project}}.revision.linux.{{head_rev}}.{{build_name}}'
-    - 'index.gecko.v1.{{project}}.latest.linux.{{build_name}}'
   scopes:
     - 'docker-worker:cache:level-{{level}}-hg-shared'
     - 'docker-worker:cache:level-{{level}}-checkouts'
 
   payload:
     # Thirty minutes should be enough for lint checks
     maxRunTime: 1800
 
@@ -38,12 +35,10 @@ task:
       GECKO_BASE_REPOSITORY: '{{base_repository}}'
       GECKO_HEAD_REPOSITORY: '{{head_repository}}'
       GECKO_HEAD_REV: '{{head_rev}}'
 
   extra:
     build_product: '{{build_product}}'
     build_name: {{build_name}}
     build_type: {{build_type}}
-    index:
-      rank: {{rank}}
     treeherder:
       jobKind: test
--- a/taskcluster/taskgraph/task/legacy.py
+++ b/taskcluster/taskgraph/task/legacy.py
@@ -488,17 +488,23 @@ class LegacyTask(base.Task):
 
             # Copy build_* attributes to expose them to post-build tasks
             # as well as json routes and tests
             task_extra = build_task['task']['extra']
             build_parameters['build_name'] = task_extra['build_name']
             build_parameters['build_type'] = task_extra['build_type']
             build_parameters['build_product'] = task_extra['build_product']
 
-            if 'treeherder' in task_extra:
+            # jobs don't have indexes
+            if build.get('is_job'):
+                try:
+                    del task_extra['index']
+                except KeyError:
+                    pass
+            elif 'treeherder' in task_extra:
                 tier = task_extra['treeherder'].get('tier', 1)
                 if tier != 1:
                     # Only tier 1 jobs use the build time as rank. Everything
                     # else gets rank 0 until it is promoted to tier 1.
                     task_extra['index']['rank'] = 0
 
             set_interactive_task(build_task, interactive)
 
@@ -507,19 +513,20 @@ class LegacyTask(base.Task):
                 remove_caches_from_task(build_task)
                 remove_coalescing_from_task(build_task)
                 set_expiration(build_task, TRY_EXPIRATION)
 
             decorate_task_treeherder_routes(build_task['task'],
                                             build_parameters['project'],
                                             build_parameters['head_rev'],
                                             build_parameters['pushlog_id'])
-            decorate_task_json_routes(build_task['task'],
-                                      json_routes,
-                                      build_parameters)
+            if not build.get('is_job'):
+                decorate_task_json_routes(build_task['task'],
+                                          json_routes,
+                                          build_parameters)
 
             # Ensure each build graph is valid after construction.
             validate_build_task(build_task)
             attributes = build_task['attributes'] = {'kind': 'legacy', 'legacy_kind': 'build'}
             if 'build_name' in build:
                 attributes['build_platform'] = build['build_name']
             if 'build_type' in task_extra:
                 attributes['build_type'] = {'dbg': 'debug'}.get(task_extra['build_type'],