Bug 832007 - Include HG revision URL in the Telemetry packet. r=nfroyd

This commit is contained in:
Vladan Djeric 2013-02-20 13:46:47 -05:00
parent c1319dcdcb
commit 28430537d4
3 changed files with 12 additions and 0 deletions

View File

@ -63,6 +63,11 @@ ifdef MOZILLA_OFFICIAL
DEFINES += -DMOZILLA_OFFICIAL
endif
MOZ_HISTOGRAMS_VERSION ?= $(shell hg path default)rev/$(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null)
ifdef MOZ_HISTOGRAMS_VERSION
DEFINES += -DHISTOGRAMS_FILE_VERSION="$(MOZ_HISTOGRAMS_VERSION)"
endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

View File

@ -19,6 +19,10 @@ Cu.import("resource://gre/modules/ctypes.jsm");
// When modifying the payload in incompatible ways, please bump this version number
const PAYLOAD_VERSION = 1;
// This is the HG changeset of the Histogram.json file, used to associate
// submitted ping data with its histogram definition (bug 832007)
#expand const HISTOGRAMS_FILE_VERSION = "__HISTOGRAMS_FILE_VERSION__";
const PREF_SERVER = "toolkit.telemetry.server";
#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
const PREF_ENABLED = "toolkit.telemetry.enabledPreRelease";
@ -359,6 +363,7 @@ TelemetryPing.prototype = {
appBuildID: ai.appBuildID,
appUpdateChannel: UpdateChannel.get(),
platformBuildID: ai.platformBuildID,
revision: HISTOGRAMS_FILE_VERSION,
locale: getLocale()
};

View File

@ -156,6 +156,8 @@ function checkPayloadInfo(payload, reason) {
do_check_eq(payload.info.reason, reason);
do_check_true("appUpdateChannel" in payload.info);
do_check_true("locale" in payload.info);
do_check_true("revision" in payload.info);
do_check_true(payload.info.revision.startsWith("http"));
try {
// If we've not got nsIGfxInfoDebug, then this will throw and stop us doing