Bug 1245953 - Fail fast if no VCS info defined; r=garndt
authorGregory Szorc <gps@mozilla.com>
Tue, 16 Feb 2016 12:19:13 -0800
changeset 284632 2ae135674c0bc62796dc907700bce1223a850851
parent 284631 870ae50e413d371973492883c690f690f370aa0a
child 284633 c3734f50f9468a50d429dff5d8ea9bf54a0a5e78
push id17681
push usercbook@mozilla.com
push dateThu, 18 Feb 2016 13:04:48 +0000
treeherderfx-team@c0353b6aa70b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgarndt
bugs1245953
milestone47.0a1
Bug 1245953 - Fail fast if no VCS info defined; r=garndt Before, we attempted to build and query a URL that potentially had "None" in it. This printed some wonky messages in the log and may have contributed to added latency due to the HTTP request that was doomed to fail. MozReview-Commit-ID: JrR5PK33vCn
testing/taskcluster/mach_commands.py
--- a/testing/taskcluster/mach_commands.py
+++ b/testing/taskcluster/mach_commands.py
@@ -144,16 +144,20 @@ def remove_caches_from_task(task):
     except KeyError:
         pass
 
 def query_vcs_info(repository, revision):
     """Query the pushdate and pushid of a repository/revision.
     This is intended to be used on hg.mozilla.org/mozilla-central and
     similar. It may or may not work for other hg repositories.
     """
+    if not repository or not revision:
+        sys.stderr.write('cannot query vcs info because vcs info not provided\n')
+        return None
+
     PushInfo = namedtuple('PushInfo', ['pushid', 'pushdate'])
 
     try:
         import requests
         url = '%s/json-pushes?changeset=%s' % (repository, revision)
         sys.stderr.write("Querying URL for pushdate: %s\n" % url)
         contents = requests.get(url).json()