From 85d94551dda35dee937b6266bca8c10ad3466932 Mon Sep 17 00:00:00 2001 From: Barry Chen Date: Tue, 3 Sep 2024 17:22:31 -0500 Subject: [PATCH] fix(Glean): use the configured app channel for Glean in Settings Because: - Glean in Settings was initialized with the default "development" value This commit: - uses the actual configuration value for the app channel --- packages/fxa-settings/src/components/App/index.test.tsx | 2 +- packages/fxa-settings/src/components/App/index.tsx | 2 +- packages/fxa-settings/src/lib/config.ts | 4 ++-- packages/fxa-settings/src/lib/glean/index.test.ts | 4 ++-- packages/fxa-settings/src/lib/glean/index.ts | 2 +- packages/fxa-shared/metrics/glean/web/index.ts | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/fxa-settings/src/components/App/index.test.tsx b/packages/fxa-settings/src/components/App/index.test.tsx index 2602d7a88f..2644d813b5 100644 --- a/packages/fxa-settings/src/components/App/index.test.tsx +++ b/packages/fxa-settings/src/components/App/index.test.tsx @@ -218,7 +218,7 @@ describe('glean', () => { ...config.glean, enabled: mockMetricsQueryAccountGlean.metricsEnabled, appDisplayVersion: config.version, - channel: config.glean.channel, + appChannel: config.glean.appChannel, }, { metricsFlow: updatedFlowQueryParams, diff --git a/packages/fxa-settings/src/components/App/index.tsx b/packages/fxa-settings/src/components/App/index.tsx index 3ff1ffb851..d66d720363 100644 --- a/packages/fxa-settings/src/components/App/index.tsx +++ b/packages/fxa-settings/src/components/App/index.tsx @@ -173,7 +173,7 @@ export const App = ({ ...config.glean, enabled: metricsEnabled, appDisplayVersion: config.version, - channel: config.glean.channel, + appChannel: config.glean.appChannel, }, { metricsFlow, diff --git a/packages/fxa-settings/src/lib/config.ts b/packages/fxa-settings/src/lib/config.ts index 667b7583d2..f99aa2b145 100644 --- a/packages/fxa-settings/src/lib/config.ts +++ b/packages/fxa-settings/src/lib/config.ts @@ -72,7 +72,7 @@ export interface Config { applicationId: string; uploadEnabled: boolean; appDisplayVersion: string; - channel: string; + appChannel: string; serverEndpoint: string; logPings: boolean; debugViewTag: string; @@ -153,7 +153,7 @@ export function getDefault() { enabled: false, applicationId: 'accounts_frontend_dev', uploadEnabled: true, - channel: 'development', + appChannel: 'development', serverEndpoint: 'https://incoming.telemetry.mozilla.org', logPings: false, debugViewTag: '', diff --git a/packages/fxa-settings/src/lib/glean/index.test.ts b/packages/fxa-settings/src/lib/glean/index.test.ts index 7b8f92e878..1d35337063 100644 --- a/packages/fxa-settings/src/lib/glean/index.test.ts +++ b/packages/fxa-settings/src/lib/glean/index.test.ts @@ -38,7 +38,7 @@ const mockConfig: Config['glean'] = { applicationId: 'testo', uploadEnabled: true, appDisplayVersion: '9001', - channel: 'test', + appChannel: 'test', serverEndpoint: 'https://metrics.example.io/', logPings: false, debugViewTag: '', @@ -195,7 +195,7 @@ describe('lib/glean', () => { mockConfig.uploadEnabled, { appDisplayVersion: mockConfig.appDisplayVersion, - channel: mockConfig.channel, + channel: mockConfig.appChannel, serverEndpoint: mockConfig.serverEndpoint, enableAutoPageLoadEvents: true, enableAutoElementClickEvents: true, diff --git a/packages/fxa-settings/src/lib/glean/index.ts b/packages/fxa-settings/src/lib/glean/index.ts index bbceb9a0a8..35c83fc7e4 100644 --- a/packages/fxa-settings/src/lib/glean/index.ts +++ b/packages/fxa-settings/src/lib/glean/index.ts @@ -539,7 +539,7 @@ export const GleanMetrics: Pick< if (config.enabled) { Glean.initialize(config.applicationId, config.uploadEnabled, { appDisplayVersion: config.appDisplayVersion, - channel: config.channel, + channel: config.appChannel, serverEndpoint: config.serverEndpoint, enableAutoPageLoadEvents: true, enableAutoElementClickEvents: true, diff --git a/packages/fxa-shared/metrics/glean/web/index.ts b/packages/fxa-shared/metrics/glean/web/index.ts index 5d52d3bed8..04c40d88e4 100644 --- a/packages/fxa-shared/metrics/glean/web/index.ts +++ b/packages/fxa-shared/metrics/glean/web/index.ts @@ -7,7 +7,7 @@ export type GleanMetricsConfig = { applicationId: string; uploadEnabled: boolean; appDisplayVersion: string; - channel: string; + appChannel: string; serverEndpoint: string; logPings: boolean; debugViewTag: string;