diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 59a28fd6e8..0e40bd6a30 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -103,7 +103,6 @@ exports[`should create default config 1`] = ` "privateProjects": false, "proPlanAutoCharge": false, "responseTimeWithAppNameKillSwitch": false, - "slackAppAddon": false, "strictSchemaValidation": false, "variantTypeNumber": false, }, @@ -142,7 +141,6 @@ exports[`should create default config 1`] = ` "privateProjects": false, "proPlanAutoCharge": false, "responseTimeWithAppNameKillSwitch": false, - "slackAppAddon": false, "strictSchemaValidation": false, "variantTypeNumber": false, }, diff --git a/src/lib/addons/addon-schema.ts b/src/lib/addons/addon-schema.ts index dd7b4dcbe6..1e3e0b212e 100644 --- a/src/lib/addons/addon-schema.ts +++ b/src/lib/addons/addon-schema.ts @@ -9,7 +9,7 @@ export const addonDefinitionSchema = joi.object().keys({ documentationUrl: joi.string().uri({ scheme: [/https?/] }), description: joi.string().allow(''), howTo: joi.string().optional().allow(''), - deprecated: joi.boolean().optional().default(false), + deprecated: joi.string().optional().allow(''), parameters: joi .array() .optional() diff --git a/src/lib/addons/index.ts b/src/lib/addons/index.ts index c6376dcd8a..39b6d137ac 100644 --- a/src/lib/addons/index.ts +++ b/src/lib/addons/index.ts @@ -5,7 +5,6 @@ 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; @@ -14,28 +13,15 @@ export interface IAddonProviders { export const getAddons: (args: { getLogger: LogProvider; unleashUrl: string; - flagResolver: IFlagResolver; -}) => IAddonProviders = ({ getLogger, unleashUrl, flagResolver }) => { - const slackAppAddonEnabled = flagResolver.isEnabled('slackAppAddon'); - - const slackAddon = new SlackAddon({ getLogger, unleashUrl }); - - if (slackAppAddonEnabled) { - slackAddon.definition.deprecated = - 'This integration is deprecated. Please try the new Slack App integration instead.'; - } - +}) => IAddonProviders = ({ getLogger, unleashUrl }) => { const addons: Addon[] = [ new Webhook({ getLogger }), - slackAddon, + new SlackAddon({ getLogger, unleashUrl }), + new SlackAppAddon({ getLogger, unleashUrl }), new TeamsAddon({ getLogger, unleashUrl }), new DatadogAddon({ getLogger, unleashUrl, flagResolver }), ]; - if (slackAppAddonEnabled) { - addons.push(new SlackAppAddon({ getLogger, unleashUrl })); - } - return addons.reduce((map, addon) => { // eslint-disable-next-line no-param-reassign map[addon.name] = addon; diff --git a/src/lib/addons/slack-definition.ts b/src/lib/addons/slack-definition.ts index ebbec92969..e2407b7550 100644 --- a/src/lib/addons/slack-definition.ts +++ b/src/lib/addons/slack-definition.ts @@ -22,6 +22,8 @@ const slackDefinition: IAddonDefinition = { displayName: 'Slack', description: 'Allows Unleash to post updates to Slack.', documentationUrl: 'https://docs.getunleash.io/docs/addons/slack', + deprecated: + 'This integration is deprecated. Please try the new Slack App integration instead.', alerts: [ { type: 'warning', diff --git a/src/lib/services/addon-service.ts b/src/lib/services/addon-service.ts index 3105d321a9..3b4599c0c7 100644 --- a/src/lib/services/addon-service.ts +++ b/src/lib/services/addon-service.ts @@ -49,11 +49,7 @@ export default class AddonService { IUnleashStores, 'addonStore' | 'eventStore' | 'featureToggleStore' >, - { - getLogger, - server, - flagResolver, - }: Pick, + { getLogger, server }: Pick, tagTypeService: TagTypeService, addons?: IAddonProviders, ) { @@ -68,7 +64,6 @@ export default class AddonService { getAddons({ getLogger, unleashUrl: server.unleashUrl, - flagResolver, }); this.sensitiveParams = this.loadSensitiveParams(this.addonProviders); if (addonStore) { diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index d7dd19770f..907989dd49 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -20,7 +20,6 @@ export type IFlagKey = | 'disableBulkToggle' | 'disableNotifications' | 'advancedPlayground' - | 'slackAppAddon' | 'filterInvalidClientMetrics' | 'lastSeenByEnvironment' | 'customRootRolesKillSwitch' @@ -99,10 +98,6 @@ const flags: IFlags = { process.env.DISABLE_NOTIFICATIONS, false, ), - slackAppAddon: parseEnvVarBoolean( - process.env.UNLEASH_SLACK_APP_ADDON, - false, - ), filterInvalidClientMetrics: parseEnvVarBoolean( process.env.FILTER_INVALID_CLIENT_METRICS, false, diff --git a/src/server-dev.ts b/src/server-dev.ts index 41e7ed2177..730e3ac25b 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -37,7 +37,6 @@ process.nextTick(async () => { embedProxyFrontend: true, anonymiseEventLog: false, responseTimeWithAppNameKillSwitch: false, - slackAppAddon: true, lastSeenByEnvironment: true, featureNamingPattern: true, doraMetrics: true, diff --git a/src/test/e2e/api/admin/addon.e2e.test.ts b/src/test/e2e/api/admin/addon.e2e.test.ts index 5ead1b23dd..595de3cf21 100644 --- a/src/test/e2e/api/admin/addon.e2e.test.ts +++ b/src/test/e2e/api/admin/addon.e2e.test.ts @@ -13,7 +13,6 @@ beforeAll(async () => { experimental: { flags: { strictSchemaValidation: true, - slackAppAddon: true, }, }, });