Bug 1525968 - Pre: Log more with `./mach artifact install -v`. r=froydnj
authorNick Alexander <nalexander@mozilla.com>
Wed, 27 Mar 2019 22:37:30 +0000
changeset 467138 e44091ef8d3f4e0423bfc234740b8b38198ecf0e
parent 467137 c75b53bc557a9d76fe35e71849288ab7aa785adf
child 467139 bcc2aef70db38869ae7efae558e28d431cab9d15
push id81992
push usernalexander@mozilla.com
push dateMon, 01 Apr 2019 21:27:52 +0000
treeherderautoland@360e565d9175 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1525968
milestone68.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 1525968 - Pre: Log more with `./mach artifact install -v`. r=froydnj It's not helpful to have a DEBUG log level, 'cuz the -v flag to `./mach artifact install` doesn't turn on DEBUG logging. Differential Revision: https://phabricator.services.mozilla.com/D19090
python/mozbuild/mozbuild/artifacts.py
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -182,17 +182,17 @@ class ArtifactJob(object):
             elif self._host_bins_re and self._host_bins_re.match(name):
                 yield name
             elif self._tests_re and self._tests_re.match(name):
                 tests_artifact = name
                 yield name
             elif self._symbols_archive_suffix and name.endswith(self._symbols_archive_suffix):
                 yield name
             else:
-                self.log(logging.DEBUG, 'artifact',
+                self.log(logging.INFO, 'artifact',
                          {'name': name},
                          'Not yielding artifact named {name} as a candidate artifact')
         if self._tests_re and not tests_artifact:
             raise ValueError('Expected tests archive matching "{re}", but '
                              'found none!'.format(re=self._tests_re))
 
     def process_artifact(self, filename, processed_filename):
         if filename.endswith(ArtifactJob._test_zip_archive_suffix) and self._tests_re:
@@ -594,17 +594,17 @@ class CacheManager(object):
         mkdir(cache_dir, not_indexed=True)
 
     def log(self, *args, **kwargs):
         if self._log:
             self._log(*args, **kwargs)
 
     def load_cache(self):
         if self._skip_cache:
-            self.log(logging.DEBUG, 'artifact',
+            self.log(logging.INFO, 'artifact',
                 {},
                 'Skipping cache: ignoring load_cache!')
             return
 
         try:
             items = pickle.load(open(self._cache_filename, 'rb'))
             for key, value in items:
                 self._cache[key] = value
@@ -614,27 +614,27 @@ class CacheManager(object):
             # We ignore any exception, so the cache is effectively dropped.
             self.log(logging.INFO, 'artifact',
                 {'filename': self._cache_filename, 'exception': repr(e)},
                 'Ignoring exception unpickling cache file {filename}: {exception}')
             pass
 
     def dump_cache(self):
         if self._skip_cache:
-            self.log(logging.DEBUG, 'artifact',
+            self.log(logging.INFO, 'artifact',
                 {},
                 'Skipping cache: ignoring dump_cache!')
             return
 
         ensureParentDir(self._cache_filename)
         pickle.dump(list(reversed(list(self._cache.items()))), open(self._cache_filename, 'wb'), -1)
 
     def clear_cache(self):
         if self._skip_cache:
-            self.log(logging.DEBUG, 'artifact',
+            self.log(logging.INFO, 'artifact',
                 {},
                 'Skipping cache: ignoring clear_cache!')
             return
 
         with self:
             self._cache.clear()
 
     def __enter__(self):
@@ -834,17 +834,17 @@ class ArtifactCache(object):
             # (especially on Mac OS X, where we must mount a large DMG file).
             hash = hashlib.sha256(url).hexdigest()[:16]
             # Strip query string and fragments.
             basename = os.path.basename(urlparse.urlparse(url).path)
             fname = hash + '-' + basename
 
         path = os.path.abspath(mozpath.join(self._cache_dir, fname))
         if self._skip_cache and os.path.exists(path):
-            self.log(logging.DEBUG, 'artifact',
+            self.log(logging.INFO, 'artifact',
                 {'path': path},
                 'Skipping cache: removing cached downloaded artifact {path}')
             os.remove(path)
 
         self.log(logging.INFO, 'artifact',
             {'path': path},
             'Downloading to temporary location {path}')
         try:
@@ -875,17 +875,17 @@ class ArtifactCache(object):
                 'Downloaded artifact to {path}')
             return os.path.abspath(mozpath.join(self._cache_dir, fname))
         finally:
             # Cancel any background downloads in progress.
             self._download_manager.cancel()
 
     def clear_cache(self):
         if self._skip_cache:
-            self.log(logging.DEBUG, 'artifact',
+            self.log(logging.INFO, 'artifact',
                 {},
                 'Skipping cache: ignoring clear_cache!')
             return
 
         self._persist_limit.remove_all()
 
 
 class Artifacts(object):
@@ -1060,20 +1060,20 @@ see https://developer.mozilla.org/en-US/
 
         pairs = map(to_pair, last_revs)
 
         # Python's tuple sort orders by first component: here, the (local)
         # revision number.
         nodes = [pair[1] for pair in sorted(pairs, reverse=True)]
 
         for node in nodes[:20]:
-            self.log(logging.DEBUG, 'artifact',
+            self.log(logging.INFO, 'artifact',
                      {'node': node},
                      'hg suggested candidate revision: {node}')
-        self.log(logging.DEBUG, 'artifact',
+        self.log(logging.INFO, 'artifact',
                  {'remaining': max(0, len(nodes) - 20)},
                  'hg suggested candidate revision: and {remaining} more')
 
         return nodes
 
     def _find_pushheads(self):
         """Returns an iterator of recent pushhead revisions, starting with the
         working parent.
@@ -1123,17 +1123,17 @@ see https://developer.mozilla.org/en-US/
         self.log(logging.INFO, 'artifact',
             {'filename': filename},
             'Installing from {filename}')
 
         # Do we need to post-process?
         processed_filename = filename + PROCESSED_SUFFIX
 
         if self._skip_cache and os.path.exists(processed_filename):
-            self.log(logging.DEBUG, 'artifact',
+            self.log(logging.INFO, 'artifact',
                 {'path': processed_filename},
                 'Skipping cache: removing cached processed artifact {path}')
             os.remove(processed_filename)
 
         if not os.path.exists(processed_filename):
             self.log(logging.INFO, 'artifact',
                 {'filename': filename},
                 'Processing contents of {filename}')
@@ -1185,17 +1185,17 @@ see https://developer.mozilla.org/en-US/
 
         urls = None
         count = 0
         # with blocks handle handle persistence.
         with self._task_cache as task_cache:
             for trees, hg_hash in hg_pushheads:
                 for tree in trees:
                     count += 1
-                    self.log(logging.DEBUG, 'artifact',
+                    self.log(logging.INFO, 'artifact',
                              {'hg_hash': hg_hash,
                               'tree': tree},
                              'Trying to find artifacts for hg revision {hg_hash} on tree {tree}.')
                     urls = self.find_pushhead_artifacts(task_cache, self._job, tree, hg_hash)
                     if urls:
                         for url in urls:
                             if self.install_from_url(url, distdir):
                                 return 1