Bug 1274311 - tier-2 jobs should have rank 0 in the index; r=dustin
authorMike Shal <mshal@mozilla.com>
Fri, 24 Jun 2016 15:59:24 -0400
changeset 303008 47c2b7937aa70bc0bdcede6be34d686e36ddd434
parent 303007 eef51590d89c21ed69e5186ba3f22c5183cbcf9d
child 303009 5c0b7eae936afa4d28c8840c3c75e554ee665fe4
push id30379
push usercbook@mozilla.com
push dateWed, 29 Jun 2016 14:13:35 +0000
treeherdermozilla-central@b69a5bbb5e40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1274311
milestone50.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 1274311 - tier-2 jobs should have rank 0 in the index; r=dustin MozReview-Commit-ID: 1CeJ7s6Eay3
taskcluster/ci/legacy/tasks/build.yml
taskcluster/ci/legacy/tasks/harness_test.yml
taskcluster/ci/legacy/tasks/lint.yml
taskcluster/ci/legacy/tasks/phone_build.yml
taskcluster/taskgraph/kind/legacy.py
--- a/taskcluster/ci/legacy/tasks/build.yml
+++ b/taskcluster/ci/legacy/tasks/build.yml
@@ -31,14 +31,14 @@ task:
       MOZ_BUILD_DATE: '{{pushdate}}'
       MOZ_SCM_LEVEL: '{{level}}'
 
   extra:
     build_product: '{{build_product}}'
     build_name: '{{build_name}}'
     build_type: '{{build_type}}'
     index:
-      rank: {{push_epoch}}
+      rank: {{rank}}
     treeherder:
       jobKind: build
       groupSymbol: tc
       groupName: Submitted by taskcluster
       symbol: B
--- a/taskcluster/ci/legacy/tasks/harness_test.yml
+++ b/taskcluster/ci/legacy/tasks/harness_test.yml
@@ -60,13 +60,13 @@ task:
     # These definitions are expected of build tasks but not used in our case
     build_product: '{{build_product}}'
     build_name: '{{build_name}}'
     build_type: '{{build_type}}'
     locations:
         build: null
         tests: null
     index:
-      rank: {{push_epoch}}
+      rank: {{rank}}
     treeherder:
       jobKind: test
       groupSymbol: tc
       groupName: Submitted by taskcluster
--- a/taskcluster/ci/legacy/tasks/lint.yml
+++ b/taskcluster/ci/legacy/tasks/lint.yml
@@ -32,11 +32,11 @@ task:
     cache:
       level-{{level}}-{{project}}-tc-vcs: '/home/worker/.tc-vcs'
 
   extra:
     build_product: '{{build_product}}'
     build_name: {{build_name}}
     build_type: {{build_type}}
     index:
-      rank: {{push_epoch}}
+      rank: {{rank}}
     treeherder:
       jobKind: test
--- a/taskcluster/ci/legacy/tasks/phone_build.yml
+++ b/taskcluster/ci/legacy/tasks/phone_build.yml
@@ -56,14 +56,14 @@ task:
       GECKO_HEAD_REV: '{{head_rev}}'
       GECKO_HEAD_REF: '{{head_ref}}'
 
   extra:
     build_product: 'b2g'
     build_name: '{{build_name}}'
     build_type: '{{build_type}}'
     index:
-      rank: {{push_epoch}}
+      rank: {{rank}}
     treeherder:
       jobKind: build
       groupSymbol: tc
       groupName: Submitted by taskcluster
       symbol: B
--- a/taskcluster/taskgraph/kind/legacy.py
+++ b/taskcluster/taskgraph/kind/legacy.py
@@ -350,21 +350,21 @@ class LegacyTask(base.Task):
             'pushlog_id': params.get('pushlog_id', 0),
             'docker_image': docker_image,
             'base_repository': params['base_repository'] or
             params['head_repository'],
             'head_repository': params['head_repository'],
             'head_ref': params['head_ref'] or params['head_rev'],
             'head_rev': params['head_rev'],
             'pushdate': pushdate,
-            'push_epoch': push_epoch,
             'pushtime': pushdate[8:],
             'year': pushdate[0:4],
             'month': pushdate[4:6],
             'day': pushdate[6:8],
+            'rank': push_epoch,
             'owner': params['owner'],
             'level': params['level'],
             'from_now': json_time_from_now,
             'now': current_json_time(),
         }.items())
 
         routes_file = os.path.join(root, 'routes.json')
         with open(routes_file) as f:
@@ -444,16 +444,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:
+                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)
 
             # try builds don't use cache
             if project == "try":
                 remove_caches_from_task(build_task)
                 set_expiration(build_task, json_time_from_now(TRY_EXPIRATION))
 
             decorate_task_treeherder_routes(build_task['task'],