Bug 1250897 - Add build number data in Telemetry pings draft
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 26 Feb 2016 14:04:12 +0100
changeset 334933 8f5f5c7faac18df37ca92251de28f26dab7e0b98
parent 334887 b73632b2d7243de58d081c6cdc94dd2aa43e6162
child 515032 b1f32a423f4bdcab8c85120d33b517c81f34c91a
push id11676
push usersledru@mozilla.com
push dateFri, 26 Feb 2016 15:21:52 +0000
bugs1250897
milestone47.0a1
Bug 1250897 - Add build number data in Telemetry pings MozReview-Commit-ID: 2CB5CMGQN6G
toolkit/components/telemetry/TelemetryController.jsm
toolkit/components/telemetry/docs/common-ping.rst
toolkit/components/telemetry/tests/unit/test_TelemetryController.js
--- a/toolkit/components/telemetry/TelemetryController.jsm
+++ b/toolkit/components/telemetry/TelemetryController.jsm
@@ -376,16 +376,17 @@ var Impl = {
       this._log.trace("_getApplicationSection - Unable to get update channel.", e);
     }
 
     return {
       architecture: arch,
       buildId: Services.appinfo.appBuildID,
       name: Services.appinfo.name,
       version: Services.appinfo.version,
+      displayVersion: AppConstants.MOZ_APP_VERSION_DISPLAY,
       vendor: Services.appinfo.vendor,
       platformVersion: Services.appinfo.platformVersion,
       xpcomAbi: Services.appinfo.XPCOMABI,
       channel: updateChannel,
     };
   },
 
   /**
--- a/toolkit/components/telemetry/docs/common-ping.rst
+++ b/toolkit/components/telemetry/docs/common-ping.rst
@@ -22,16 +22,17 @@ Structure::
       creationDate: <ISO date>, // the date the ping was generated
       version: <number>, // the version of the ping format, currently 4
 
       application: {
         architecture: <string>, // build architecture, e.g. x86
         buildId: <string>, // "20141126041045"
         name: <string>, // "Firefox"
         version: <string>, // "35.0"
+        displayVersion: <string>, // "35.0b3"
         vendor: <string>, // "Mozilla"
         platformVersion: <string>, // "35.0"
         xpcomAbi: <string>, // e.g. "x86-msvc"
         channel: <string>, // "beta"
       },
 
       clientId: <UUID>, // optional
       environment: { ... }, // optional, not all pings contain the environment
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryController.js
@@ -53,16 +53,17 @@ function checkPingFormat(aPing, aType, a
   const MANDATORY_PING_FIELDS = [
     "type", "id", "creationDate", "version", "application", "payload"
   ];
 
   const APPLICATION_TEST_DATA = {
     buildId: "2007010101",
     name: APP_NAME,
     version: APP_VERSION,
+    displayVersion: AppConstants.MOZ_APP_VERSION_DISPLAY,
     vendor: "Mozilla",
     platformVersion: PLATFORM_VERSION,
     xpcomAbi: "noarch-spidermonkey",
   };
 
   // Check that the ping contains all the mandatory fields.
   for (let f of MANDATORY_PING_FIELDS) {
     Assert.ok(f in aPing, f + " must be available.");