Bug 1304176 - Use vendored tooltool.py if available; r?ted draft
authorGregory Szorc <gps@mozilla.com>
Tue, 20 Sep 2016 12:36:33 -0700
changeset 417180 721b4037a2bd1f1ed10fcc7954ed9e0ba13e7693
parent 417179 2cfc03bab8a6d0952e34da5dc605c8dd4d5e1b18
child 417181 70b233393273cbad194bcf0defe47206a08b96c3
push id30356
push userbmo:gps@mozilla.com
push dateFri, 23 Sep 2016 19:11:51 +0000
reviewersted
bugs1304176
milestone52.0a1
Bug 1304176 - Use vendored tooltool.py if available; r?ted Now that we can detect when we're running from a source checkout, we can start using things from source checkouts instead of relying on host machine state or grabbing files from another server. We start by using the vendored tooltool.py if available. This avoids non-determinism. It avoids a possible 3rd party hosting dependency on github.com. It avoids a possible MitM attack vector. Wins all around. MozReview-Commit-ID: L6hLveHZxBR
testing/mozharness/mozharness/mozilla/tooltool.py
--- a/testing/mozharness/mozharness/mozilla/tooltool.py
+++ b/testing/mozharness/mozharness/mozilla/tooltool.py
@@ -42,18 +42,24 @@ class TooltoolMixin(object):
         # take care of auth.  Everywhere else, we'll get auth failures if
         # necessary.
         if os.path.exists(fn):
             return fn
 
     def tooltool_fetch(self, manifest,
                        output_dir=None, privileged=False, cache=None):
         """docstring for tooltool_fetch"""
-
-        if self.config.get("download_tooltool"):
+        # Use vendored tooltool.py if available.
+        if self.topsrcdir:
+            cmd = [
+                sys.executable,
+                os.path.join(self.topsrcdir, 'testing', 'docker', 'recipes',
+                                'tooltool.py')
+            ]
+        elif self.config.get("download_tooltool"):
             cmd = [sys.executable, self._fetch_tooltool_py()]
         else:
             cmd = self.query_exe('tooltool.py', return_type='list')
 
         # get the tooltool servers from configuration
         default_urls = self.config.get('tooltool_servers', TOOLTOOL_SERVERS)
 
         # add slashes (bug 1155630)