From 7eae1f83825adb038e3ebbf6c6de5b0a92ed3aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Thu, 21 Sep 2023 14:07:24 +0100 Subject: [PATCH] fix: datadog addon needs flagResolver (#4806) Fixes what this breaks: https://github.com/Unleash/unleash/pull/4765 - The Datadog integration needs a `flagResolver`. --- src/lib/addons/index.ts | 4 +++- src/lib/services/addon-service.ts | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/addons/index.ts b/src/lib/addons/index.ts index 39b6d137ac..9f88f33faa 100644 --- a/src/lib/addons/index.ts +++ b/src/lib/addons/index.ts @@ -5,6 +5,7 @@ import DatadogAddon from './datadog'; import Addon from './addon'; import { LogProvider } from '../logger'; import SlackAppAddon from './slack-app'; +import { IFlagResolver } from '../types'; export interface IAddonProviders { [key: string]: Addon; @@ -13,7 +14,8 @@ export interface IAddonProviders { export const getAddons: (args: { getLogger: LogProvider; unleashUrl: string; -}) => IAddonProviders = ({ getLogger, unleashUrl }) => { + flagResolver: IFlagResolver; +}) => IAddonProviders = ({ getLogger, unleashUrl, flagResolver }) => { const addons: Addon[] = [ new Webhook({ getLogger }), new SlackAddon({ getLogger, unleashUrl }), diff --git a/src/lib/services/addon-service.ts b/src/lib/services/addon-service.ts index 3b4599c0c7..3105d321a9 100644 --- a/src/lib/services/addon-service.ts +++ b/src/lib/services/addon-service.ts @@ -49,7 +49,11 @@ export default class AddonService { IUnleashStores, 'addonStore' | 'eventStore' | 'featureToggleStore' >, - { getLogger, server }: Pick, + { + getLogger, + server, + flagResolver, + }: Pick, tagTypeService: TagTypeService, addons?: IAddonProviders, ) { @@ -64,6 +68,7 @@ export default class AddonService { getAddons({ getLogger, unleashUrl: server.unleashUrl, + flagResolver, }); this.sensitiveParams = this.loadSensitiveParams(this.addonProviders); if (addonStore) {