1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00

chore: GA (remove flag) for Slack App integration (#4765)

https://linear.app/unleash/issue/2-1405/remove-slackappaddon-feature-flag-and-make-this-ga

GA's the new Slack App integration by removing the feature flag 🚀
This commit is contained in:
Nuno Góis 2023-09-21 13:55:58 +01:00 committed by GitHub
parent 6884f9cdc9
commit ea9901c968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 7 additions and 33 deletions

View File

@ -103,7 +103,6 @@ exports[`should create default config 1`] = `
"privateProjects": false, "privateProjects": false,
"proPlanAutoCharge": false, "proPlanAutoCharge": false,
"responseTimeWithAppNameKillSwitch": false, "responseTimeWithAppNameKillSwitch": false,
"slackAppAddon": false,
"strictSchemaValidation": false, "strictSchemaValidation": false,
"variantTypeNumber": false, "variantTypeNumber": false,
}, },
@ -142,7 +141,6 @@ exports[`should create default config 1`] = `
"privateProjects": false, "privateProjects": false,
"proPlanAutoCharge": false, "proPlanAutoCharge": false,
"responseTimeWithAppNameKillSwitch": false, "responseTimeWithAppNameKillSwitch": false,
"slackAppAddon": false,
"strictSchemaValidation": false, "strictSchemaValidation": false,
"variantTypeNumber": false, "variantTypeNumber": false,
}, },

View File

@ -9,7 +9,7 @@ export const addonDefinitionSchema = joi.object().keys({
documentationUrl: joi.string().uri({ scheme: [/https?/] }), documentationUrl: joi.string().uri({ scheme: [/https?/] }),
description: joi.string().allow(''), description: joi.string().allow(''),
howTo: joi.string().optional().allow(''), howTo: joi.string().optional().allow(''),
deprecated: joi.boolean().optional().default(false), deprecated: joi.string().optional().allow(''),
parameters: joi parameters: joi
.array() .array()
.optional() .optional()

View File

@ -5,7 +5,6 @@ import DatadogAddon from './datadog';
import Addon from './addon'; import Addon from './addon';
import { LogProvider } from '../logger'; import { LogProvider } from '../logger';
import SlackAppAddon from './slack-app'; import SlackAppAddon from './slack-app';
import { IFlagResolver } from '../types';
export interface IAddonProviders { export interface IAddonProviders {
[key: string]: Addon; [key: string]: Addon;
@ -14,28 +13,15 @@ export interface IAddonProviders {
export const getAddons: (args: { export const getAddons: (args: {
getLogger: LogProvider; getLogger: LogProvider;
unleashUrl: string; unleashUrl: string;
flagResolver: IFlagResolver; }) => IAddonProviders = ({ getLogger, unleashUrl }) => {
}) => 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.';
}
const addons: Addon[] = [ const addons: Addon[] = [
new Webhook({ getLogger }), new Webhook({ getLogger }),
slackAddon, new SlackAddon({ getLogger, unleashUrl }),
new SlackAppAddon({ getLogger, unleashUrl }),
new TeamsAddon({ getLogger, unleashUrl }), new TeamsAddon({ getLogger, unleashUrl }),
new DatadogAddon({ getLogger, unleashUrl, flagResolver }), new DatadogAddon({ getLogger, unleashUrl, flagResolver }),
]; ];
if (slackAppAddonEnabled) {
addons.push(new SlackAppAddon({ getLogger, unleashUrl }));
}
return addons.reduce((map, addon) => { return addons.reduce((map, addon) => {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
map[addon.name] = addon; map[addon.name] = addon;

View File

@ -22,6 +22,8 @@ const slackDefinition: IAddonDefinition = {
displayName: 'Slack', displayName: 'Slack',
description: 'Allows Unleash to post updates to Slack.', description: 'Allows Unleash to post updates to Slack.',
documentationUrl: 'https://docs.getunleash.io/docs/addons/slack', documentationUrl: 'https://docs.getunleash.io/docs/addons/slack',
deprecated:
'This integration is deprecated. Please try the new Slack App integration instead.',
alerts: [ alerts: [
{ {
type: 'warning', type: 'warning',

View File

@ -49,11 +49,7 @@ export default class AddonService {
IUnleashStores, IUnleashStores,
'addonStore' | 'eventStore' | 'featureToggleStore' 'addonStore' | 'eventStore' | 'featureToggleStore'
>, >,
{ { getLogger, server }: Pick<IUnleashConfig, 'getLogger' | 'server'>,
getLogger,
server,
flagResolver,
}: Pick<IUnleashConfig, 'getLogger' | 'server' | 'flagResolver'>,
tagTypeService: TagTypeService, tagTypeService: TagTypeService,
addons?: IAddonProviders, addons?: IAddonProviders,
) { ) {
@ -68,7 +64,6 @@ export default class AddonService {
getAddons({ getAddons({
getLogger, getLogger,
unleashUrl: server.unleashUrl, unleashUrl: server.unleashUrl,
flagResolver,
}); });
this.sensitiveParams = this.loadSensitiveParams(this.addonProviders); this.sensitiveParams = this.loadSensitiveParams(this.addonProviders);
if (addonStore) { if (addonStore) {

View File

@ -20,7 +20,6 @@ export type IFlagKey =
| 'disableBulkToggle' | 'disableBulkToggle'
| 'disableNotifications' | 'disableNotifications'
| 'advancedPlayground' | 'advancedPlayground'
| 'slackAppAddon'
| 'filterInvalidClientMetrics' | 'filterInvalidClientMetrics'
| 'lastSeenByEnvironment' | 'lastSeenByEnvironment'
| 'customRootRolesKillSwitch' | 'customRootRolesKillSwitch'
@ -99,10 +98,6 @@ const flags: IFlags = {
process.env.DISABLE_NOTIFICATIONS, process.env.DISABLE_NOTIFICATIONS,
false, false,
), ),
slackAppAddon: parseEnvVarBoolean(
process.env.UNLEASH_SLACK_APP_ADDON,
false,
),
filterInvalidClientMetrics: parseEnvVarBoolean( filterInvalidClientMetrics: parseEnvVarBoolean(
process.env.FILTER_INVALID_CLIENT_METRICS, process.env.FILTER_INVALID_CLIENT_METRICS,
false, false,

View File

@ -37,7 +37,6 @@ process.nextTick(async () => {
embedProxyFrontend: true, embedProxyFrontend: true,
anonymiseEventLog: false, anonymiseEventLog: false,
responseTimeWithAppNameKillSwitch: false, responseTimeWithAppNameKillSwitch: false,
slackAppAddon: true,
lastSeenByEnvironment: true, lastSeenByEnvironment: true,
featureNamingPattern: true, featureNamingPattern: true,
doraMetrics: true, doraMetrics: true,

View File

@ -13,7 +13,6 @@ beforeAll(async () => {
experimental: { experimental: {
flags: { flags: {
strictSchemaValidation: true, strictSchemaValidation: true,
slackAppAddon: true,
}, },
}, },
}); });