Bug 1244143 - Record whether or not an artifact build was used in build telemetry data r?gps draft
authorDan Minor <dminor@mozilla.com>
Mon, 01 Feb 2016 14:41:13 -0500
changeset 330120 ae16048ba44ea76d4e41894ce150889cc54dd7d2
parent 330119 631f6146d8e65ad006b8c80dd48e30ed8c9a5959
child 514104 ec3c248159c9503c8d9627fca293cf98f5667fc4
push id10682
push userdminor@mozilla.com
push dateWed, 10 Feb 2016 18:34:32 +0000
reviewersgps
bugs1244143
milestone47.0a1
Bug 1244143 - Record whether or not an artifact build was used in build telemetry data r?gps This adds a substs field and cherrypicks the MOZ_ARTIFACT_BUILDS field so we can determine whether or not an artifact build occurred. MozReview-Commit-ID: 8aio8mP8pmR
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -490,18 +490,31 @@ class Build(MachCommandBase):
             # if excessive:
             #    print(EXCESSIVE_SWAP_MESSAGE)
 
             print('To view resource usage of the build, run |mach '
                 'resource-usage|.')
 
             telemetry_handler = getattr(self._mach_context,
                                         'telemetry_handler', None)
-            usage = monitor.record_resource_usage()
-            telemetry_handler(self._mach_context, usage)
+            telemetry_data = monitor.record_resource_usage()
+
+            # Record build configuration data. For now, we cherry pick
+            # items we need rather than grabbing everything, in order
+            # to avoid accidentally disclosing PII.
+            try:
+                moz_artifact_builds = self.substs.get('MOZ_ARTIFACT_BUILDS',
+                                                      False)
+                telemetry_data['substs'] = {
+                    'MOZ_ARTIFACT_BUILDS': moz_artifact_builds,
+                }
+            except BuildEnvironmentNotFoundException:
+                pass
+
+            telemetry_handler(self._mach_context, telemetry_data)
 
         # Only for full builds because incremental builders likely don't
         # need to be burdened with this.
         if not what:
             try:
                 # Fennec doesn't have useful output from just building. We should
                 # arguably make the build action useful for Fennec. Another day...
                 if self.substs['MOZ_BUILD_APP'] != 'mobile/android':