Skip to content
Snippets Groups Projects
Commit b9096de8 authored by Andrei Oprea's avatar Andrei Oprea
Browse files

Bug 1728990 - Require exposure event description in FeatureManifest r=k88hudson

parent 51246341
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,8 @@ const EXPORTED_SYMBOLS = ["FeatureManifest"]; ...@@ -13,6 +13,8 @@ const EXPORTED_SYMBOLS = ["FeatureManifest"];
const FeatureManifest = { const FeatureManifest = {
urlbar: { urlbar: {
description: "The Address Bar", description: "The Address Bar",
exposureDescription:
"Exposure is sent once per browsing session after the first urlbar query is made.",
variables: { variables: {
merinoEnabled: { merinoEnabled: {
type: "boolean", type: "boolean",
...@@ -66,6 +68,8 @@ const FeatureManifest = { ...@@ -66,6 +68,8 @@ const FeatureManifest = {
}, },
aboutwelcome: { aboutwelcome: {
description: "The about:welcome page", description: "The about:welcome page",
exposureDescription:
"Exposure is sent once per browsing session when the about:welcome URL is first accessed.",
isEarlyStartup: true, isEarlyStartup: true,
variables: { variables: {
enabled: { enabled: {
...@@ -93,6 +97,7 @@ const FeatureManifest = { ...@@ -93,6 +97,7 @@ const FeatureManifest = {
}, },
abouthomecache: { abouthomecache: {
description: "The startup about:home cache.", description: "The startup about:home cache.",
exposureDescription: false,
isEarlyStartup: true, isEarlyStartup: true,
variables: { variables: {
enabled: { enabled: {
...@@ -104,6 +109,7 @@ const FeatureManifest = { ...@@ -104,6 +109,7 @@ const FeatureManifest = {
}, },
firefox100: { firefox100: {
description: "Firefox User-Agent version", description: "Firefox User-Agent version",
exposureDescription: false,
isEarlyStartup: true, isEarlyStartup: true,
variables: { variables: {
firefoxVersion: { firefoxVersion: {
...@@ -114,6 +120,8 @@ const FeatureManifest = { ...@@ -114,6 +120,8 @@ const FeatureManifest = {
}, },
newtab: { newtab: {
description: "The about:newtab page", description: "The about:newtab page",
exposureDescription:
"Exposure is sent once per browsing session when the first newtab page loads (either about:newtab or about:home).",
isEarlyStartup: true, isEarlyStartup: true,
variables: { variables: {
customizationMenuEnabled: { customizationMenuEnabled: {
...@@ -130,6 +138,7 @@ const FeatureManifest = { ...@@ -130,6 +138,7 @@ const FeatureManifest = {
}, },
pocketNewtab: { pocketNewtab: {
description: "The Pocket section in newtab", description: "The Pocket section in newtab",
exposureDescription: false,
isEarlyStartup: true, isEarlyStartup: true,
variables: { variables: {
spocPositions: { spocPositions: {
...@@ -142,6 +151,7 @@ const FeatureManifest = { ...@@ -142,6 +151,7 @@ const FeatureManifest = {
}, },
"password-autocomplete": { "password-autocomplete": {
description: "A special autocomplete UI for password fields.", description: "A special autocomplete UI for password fields.",
exposureDescription: false,
variables: { variables: {
directMigrateSingleProfile: { directMigrateSingleProfile: {
type: "boolean", type: "boolean",
...@@ -151,6 +161,7 @@ const FeatureManifest = { ...@@ -151,6 +161,7 @@ const FeatureManifest = {
}, },
shellService: { shellService: {
description: "Interface with OS, e.g., pinning and set default", description: "Interface with OS, e.g., pinning and set default",
exposureDescription: false,
isEarlyStartup: true, isEarlyStartup: true,
variables: { variables: {
disablePin: { disablePin: {
...@@ -166,6 +177,7 @@ const FeatureManifest = { ...@@ -166,6 +177,7 @@ const FeatureManifest = {
}, },
upgradeDialog: { upgradeDialog: {
description: "The dialog shown for major upgrades", description: "The dialog shown for major upgrades",
exposureDescription: false,
isEarlyStartup: true, isEarlyStartup: true,
variables: { variables: {
enabled: { enabled: {
...@@ -177,6 +189,8 @@ const FeatureManifest = { ...@@ -177,6 +189,8 @@ const FeatureManifest = {
}, },
privatebrowsing: { privatebrowsing: {
description: "about:privatebrowsing", description: "about:privatebrowsing",
exposureDescription:
"Exposure is sent once per browsing session the first time the PB page loads",
variables: { variables: {
infoEnabled: { infoEnabled: {
type: "boolean", type: "boolean",
...@@ -269,6 +283,7 @@ const FeatureManifest = { ...@@ -269,6 +283,7 @@ const FeatureManifest = {
}, },
readerMode: { readerMode: {
description: "Firefox Reader Mode", description: "Firefox Reader Mode",
exposureDescription: false,
isEarlyStartup: true, isEarlyStartup: true,
variables: { variables: {
pocketCTAVersion: { pocketCTAVersion: {
......
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
"description": { "description": {
"type": "string" "type": "string"
}, },
"exposureDescription": {
"oneOf": [
{"type": "string"},
{"type": "boolean"}
]
},
"isEarlyStartup": { "isEarlyStartup": {
"type": "boolean", "type": "boolean",
"description": "If the feature values should be cached in prefs for fast early startup." "description": "If the feature values should be cached in prefs for fast early startup."
...@@ -41,7 +47,7 @@ ...@@ -41,7 +47,7 @@
} }
} }
}, },
"required": ["description"] "required": ["description", "exposureDescription"]
} }
} }
} }
...@@ -82,6 +82,10 @@ add_task(async function test_experiment_enroll_unenroll_Telemetry() { ...@@ -82,6 +82,10 @@ add_task(async function test_experiment_enroll_unenroll_Telemetry() {
}); });
add_task(async function test_experiment_expose_Telemetry() { add_task(async function test_experiment_expose_Telemetry() {
const featureManifest = {
description: "Test feature",
exposureDescription: "Used in tests",
};
const cleanup = await ExperimentFakes.enrollWithFeatureConfig({ const cleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "test-feature", featureId: "test-feature",
value: { enabled: false }, value: { enabled: false },
...@@ -92,7 +96,7 @@ add_task(async function test_experiment_expose_Telemetry() { ...@@ -92,7 +96,7 @@ add_task(async function test_experiment_expose_Telemetry() {
}); });
const { featureId } = experiment.branch.features[0]; const { featureId } = experiment.branch.features[0];
const feature = new ExperimentFeature(featureId); const feature = new ExperimentFeature(featureId, featureManifest);
Services.telemetry.clearEvents(); Services.telemetry.clearEvents();
feature.recordExposureEvent(); feature.recordExposureEvent();
......
...@@ -28,6 +28,8 @@ function setDefaultBranch(pref, value) { ...@@ -28,6 +28,8 @@ function setDefaultBranch(pref, value) {
const TEST_FALLBACK_PREF = "testprefbranch.config"; const TEST_FALLBACK_PREF = "testprefbranch.config";
const FAKE_FEATURE_MANIFEST = { const FAKE_FEATURE_MANIFEST = {
description: "Test feature",
exposureDescription: "Used in tests",
variables: { variables: {
enabled: { enabled: {
type: "boolean", type: "boolean",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment