From b9aabfcdbc62ee5532159696be229aa35721aec2 Mon Sep 17 00:00:00 2001 From: Gitar Date: Mon, 7 Oct 2024 12:55:38 +0000 Subject: [PATCH] [Gitar] Updating TypeScript files --- src/lib/addons/datadog.ts | 10 ++++------ src/lib/addons/new-relic.ts | 10 ++++------ src/lib/addons/slack-app.ts | 10 ++++------ src/lib/addons/slack.ts | 10 ++++------ src/lib/addons/teams.ts | 10 ++++------ src/lib/addons/webhook.ts | 10 ++++------ src/lib/types/experimental.ts | 5 ----- src/server-dev.ts | 1 - 8 files changed, 24 insertions(+), 42 deletions(-) diff --git a/src/lib/addons/datadog.ts b/src/lib/addons/datadog.ts index 27cf38b7d703..4b91a7c81cc7 100644 --- a/src/lib/addons/datadog.ts +++ b/src/lib/addons/datadog.ts @@ -116,12 +116,10 @@ export default class DatadogAddon extends Addon { this.logger.warn(failedMessage); } - if (this.flagResolver.isEnabled('addonUsageMetrics')) { - this.eventBus.emit(ADDON_EVENTS_HANDLED, { - result: state, - destination: 'datadog', - }); - } + this.eventBus.emit(ADDON_EVENTS_HANDLED, { + result: state, + destination: 'datadog', + }); this.registerEvent({ integrationId, diff --git a/src/lib/addons/new-relic.ts b/src/lib/addons/new-relic.ts index eeebe3fcbe5c..f4d9a93a8427 100644 --- a/src/lib/addons/new-relic.ts +++ b/src/lib/addons/new-relic.ts @@ -120,12 +120,10 @@ export default class NewRelicAddon extends Addon { this.logger.warn(failedMessage); } - if (this.flagResolver.isEnabled('addonUsageMetrics')) { - this.eventBus.emit(ADDON_EVENTS_HANDLED, { - result: state, - destination: 'new-relic', - }); - } + this.eventBus.emit(ADDON_EVENTS_HANDLED, { + result: state, + destination: 'new-relic', + }); this.registerEvent({ integrationId, diff --git a/src/lib/addons/slack-app.ts b/src/lib/addons/slack-app.ts index 1df686f106f2..4d50be0357cd 100644 --- a/src/lib/addons/slack-app.ts +++ b/src/lib/addons/slack-app.ts @@ -182,12 +182,10 @@ export default class SlackAppAddon extends Addon { stateDetails.push(errorMessage); this.logger.warn(errorMessage, error); } finally { - if (this.flagResolver.isEnabled('addonUsageMetrics')) { - this.eventBus.emit(ADDON_EVENTS_HANDLED, { - result: state, - destination: 'slack-app', - }); - } + this.eventBus.emit(ADDON_EVENTS_HANDLED, { + result: state, + destination: 'slack-app', + }); this.registerEvent({ integrationId, diff --git a/src/lib/addons/slack.ts b/src/lib/addons/slack.ts index 86567632d9f3..25a9156345db 100644 --- a/src/lib/addons/slack.ts +++ b/src/lib/addons/slack.ts @@ -134,12 +134,10 @@ export default class SlackAddon extends Addon { this.logger.warn(successWithErrorsMessage); } - if (this.flagResolver.isEnabled('addonUsageMetrics')) { - this.eventBus.emit(ADDON_EVENTS_HANDLED, { - result: state, - destination: 'slack', - }); - } + this.eventBus.emit(ADDON_EVENTS_HANDLED, { + result: state, + destination: 'slack', + }); this.registerEvent({ integrationId, diff --git a/src/lib/addons/teams.ts b/src/lib/addons/teams.ts index 5c14d7204477..54cfc7b7d565 100644 --- a/src/lib/addons/teams.ts +++ b/src/lib/addons/teams.ts @@ -110,12 +110,10 @@ export default class TeamsAddon extends Addon { this.logger.warn(failedMessage); } - if (this.flagResolver.isEnabled('addonUsageMetrics')) { - this.eventBus.emit(ADDON_EVENTS_HANDLED, { - result: state, - destination: 'teams', - }); - } + this.eventBus.emit(ADDON_EVENTS_HANDLED, { + result: state, + destination: 'teams', + }); this.registerEvent({ integrationId, diff --git a/src/lib/addons/webhook.ts b/src/lib/addons/webhook.ts index ff8460704142..b388b30b4aaa 100644 --- a/src/lib/addons/webhook.ts +++ b/src/lib/addons/webhook.ts @@ -104,12 +104,10 @@ export default class Webhook extends Addon { this.logger.warn(failedMessage); } - if (this.flagResolver.isEnabled('addonUsageMetrics')) { - this.eventBus.emit(ADDON_EVENTS_HANDLED, { - result: state, - destination: 'webhook', - }); - } + this.eventBus.emit(ADDON_EVENTS_HANDLED, { + result: state, + destination: 'webhook', + }); const domain = new URL(url).hostname; this.logger.info(`Webhook invoked`, { diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 41df802b1f95..4c0989d44ded 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -54,7 +54,6 @@ export type IFlagKey = | 'extendedMetrics' | 'removeUnsafeInlineStyleSrc' | 'originMiddleware' - | 'addonUsageMetrics' | 'onboardingMetrics' | 'onboardingUI' | 'projectRoleAssignment' @@ -270,10 +269,6 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_ORIGIN_MIDDLEWARE, false, ), - addonUsageMetrics: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_ADDON_USAGE_METRICS, - false, - ), onboardingMetrics: parseEnvVarBoolean( process.env.UNLEASH_EXPERIMENTAL_ONBOARDING_METRICS, false, diff --git a/src/server-dev.ts b/src/server-dev.ts index c132b9ec9965..46162ce699e5 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -51,7 +51,6 @@ process.nextTick(async () => { enableLegacyVariants: false, extendedMetrics: true, originMiddleware: true, - addonUsageMetrics: true, onboardingMetrics: true, onboardingUI: true, personalDashboardUI: true,