Skip to content

Commit

Permalink
Updated deprecation message per PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Sep 27, 2021
1 parent db725c0 commit cdf4d81
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 51 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export const THRESHOLD_RULE_TYPE_ID = `${RULE_TYPE_PREFIX}.thresholdRule` as con

/**
* Id for the notifications alerting type
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const LEGACY_NOTIFICATIONS_ID = `siem.notifications`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { INTERNAL_RULE_ALERT_ID_KEY } from '../../../../common/constants';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyAddTags = (tags: string[], ruleAlertId: string): string[] =>
Array.from(new Set([...tags, `${INTERNAL_RULE_ALERT_ID_KEY}:${ruleAlertId}`]));
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { rulesClientMock } from '../../../../../alerting/server/mocks';
import { legacyCreateNotifications } from './legacy_create_notifications';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
describe('legacyCreateNotifications', () => {
let rulesClient: ReturnType<typeof rulesClientMock.create>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { CreateNotificationParams, LegacyRuleNotificationAlertTypeParams } from
import { legacyAddTags } from './legacy_add_tags';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyCreateNotifications = async ({
rulesClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { LEGACY_NOTIFICATIONS_ID } from '../../../../common/constants';
import { LegacyFindNotificationParams } from './legacy_types';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyGetFilter = (filter: string | null | undefined) => {
if (filter == null) {
Expand All @@ -22,7 +22,7 @@ export const legacyGetFilter = (filter: string | null | undefined) => {
};

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyFindNotifications = async ({
rulesClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { legacyFindNotifications } from './legacy_find_notifications';
import { INTERNAL_RULE_ALERT_ID_KEY } from '../../../../common/constants';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyReadNotifications = async ({
rulesClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { getQueryRuleParams } from '../schemas/rule_schemas.mock';
jest.mock('./build_signals_query');

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
describe('legacyRules_notification_alert_type', () => {
let payload: LegacyNotificationExecutorOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { getNotificationResultsLink } from './utils';
import { getSignals } from './get_signals';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should also be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyRulesNotificationAlertType = ({
logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ import { Alert, AlertAction } from '../../../../../alerting/common';
import { LEGACY_NOTIFICATIONS_ID } from '../../../../common/constants';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export interface LegacyRuleNotificationAlertTypeParams extends AlertTypeParams {
ruleAlertId: string;
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export type LegacyRuleNotificationAlertType = Alert<LegacyRuleNotificationAlertTypeParams>;

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export interface LegacyFindNotificationParams {
rulesClient: RulesClient;
Expand All @@ -44,14 +44,14 @@ export interface LegacyFindNotificationParams {
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export interface LegacyClients {
rulesClient: RulesClient;
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export interface LegacyNotificationAlertParams {
actions: AlertAction[];
Expand All @@ -62,12 +62,12 @@ export interface LegacyNotificationAlertParams {
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export type CreateNotificationParams = LegacyNotificationAlertParams & LegacyClients;

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export interface LegacyReadNotificationParams {
rulesClient: RulesClient;
Expand All @@ -76,7 +76,7 @@ export interface LegacyReadNotificationParams {
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyIsAlertType = (
partialAlert: PartialAlert<AlertTypeParams>
Expand All @@ -85,7 +85,7 @@ export const legacyIsAlertType = (
};

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export type LegacyNotificationExecutorOptions = AlertExecutorOptions<
LegacyRuleNotificationAlertTypeParams,
Expand All @@ -97,7 +97,7 @@ export type LegacyNotificationExecutorOptions = AlertExecutorOptions<
/**
* This returns true because by default a NotificationAlertTypeDefinition is an AlertType
* since we are only increasing the strictness of params.
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyIsNotificationAlertExecutor = (
obj: LegacyNotificationAlertTypeDefinition
Expand All @@ -112,7 +112,7 @@ export const legacyIsNotificationAlertExecutor = (
};

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export type LegacyNotificationAlertTypeDefinition = Omit<
AlertType<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ export const getSignalsMigrationStatusRequest = () =>
});

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyGetNotificationResult = (): LegacyRuleNotificationAlertType => ({
id: '200dbf2f-b269-4bf9-aa85-11ba32ba73ba',
Expand Down Expand Up @@ -641,7 +641,7 @@ export const legacyGetNotificationResult = (): LegacyRuleNotificationAlertType =
});

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyGetFindNotificationsResultWithSingleHit =
(): FindHit<LegacyRuleNotificationAlertType> => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { AlertAction } from '../../../../../alerting/common';
import { transformAlertToRuleAction } from '../../../../common/detection_engine/transform_actions';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
interface LegacyCreateRuleActionsSavedObject {
ruleAlertId: string;
Expand All @@ -28,7 +28,7 @@ interface LegacyCreateRuleActionsSavedObject {
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyCreateRuleActionsSavedObject = async ({
ruleAlertId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import { LegacyRulesActionsSavedObject } from './legacy_get_rule_actions_saved_o
import { buildChunkedOrFilter } from '../signals/utils';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
interface LegacyGetBulkRuleActionsSavedObject {
alertIds: string[];
savedObjectsClient: AlertServices['savedObjectsClient'];
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyGetBulkRuleActionsSavedObject = async ({
alertIds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import { LegacyIRuleActionsAttributesSavedObjectAttributes } from './legacy_type
import { legacyGetRuleActionsFromSavedObject } from './legacy_utils';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
interface LegacyGetRuleActionsSavedObject {
ruleAlertId: string;
savedObjectsClient: AlertServices['savedObjectsClient'];
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export interface LegacyRulesActionsSavedObject {
id: string;
Expand All @@ -33,7 +33,7 @@ export interface LegacyRulesActionsSavedObject {
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyGetRuleActionsSavedObject = async ({
ruleAlertId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ import {
import { LegacyIRuleActionsAttributesSavedObjectAttributes } from './legacy_types';

/**
* We keep this around to migrate and update data for the old deprecated rule actions saved object mapping but we
* do not use it anymore within the code base. Once we feel comfortable that users are upgrade far enough and this is no longer
* needed then it will be safe to remove this saved object and all its migrations
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
function isEmptyObject(obj: {}) {
for (const attr in obj) {
Expand All @@ -30,10 +27,7 @@ function isEmptyObject(obj: {}) {
}

/**
* We keep this around to migrate and update data for the old deprecated rule actions saved object mapping but we
* do not use it anymore within the code base. Once we feel comfortable that users are upgrade far enough and this is no longer
* needed then it will be safe to remove this saved object and all its migrations
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyRuleActionsSavedObjectMigration = {
'7.11.2': (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ import { SavedObjectsType } from '../../../../../../../src/core/server';
import { legacyRuleActionsSavedObjectMigration } from './legacy_migrations';

/**
* We keep this around to migrate and update data for the old deprecated rule actions saved object mapping but we
* do not use it anymore within the code base. Once we feel comfortable that users are upgrade far enough and this is no longer
* needed then it will be safe to remove this saved object and all its migrations.
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyRuleActionsSavedObjectType = 'siem-detection-engine-rule-actions';

/**
* We keep this around to migrate and update data for the old deprecated rule actions saved object mapping but we
* do not use it anymore within the code base. Once we feel comfortable that users are upgrade far enough and this is no longer
* needed then it will be safe to remove this saved object and all its migrations.
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
const legacyRuleActionsSavedObjectMappings: SavedObjectsType['mappings'] = {
properties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { legacyUpdateRuleActionsSavedObject } from './legacy_update_rule_actions
import { LegacyRuleActions } from './legacy_types';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
interface LegacyUpdateOrCreateRuleActionsSavedObject {
ruleAlertId: string;
Expand All @@ -27,7 +27,7 @@ interface LegacyUpdateOrCreateRuleActionsSavedObject {
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyUpdateOrCreateRuleActionsSavedObject = async ({
savedObjectsClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { AlertAction } from '../../../../../alerting/common';
import { transformAlertToRuleAction } from '../../../../common/detection_engine/transform_actions';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
interface LegacyUpdateRuleActionsSavedObject {
ruleAlertId: string;
Expand All @@ -29,7 +29,7 @@ interface LegacyUpdateRuleActionsSavedObject {
}

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyUpdateRuleActionsSavedObject = async ({
ruleAlertId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { RuleAlertAction } from '../../../../common/detection_engine/types';
import { LegacyIRuleActionsAttributesSavedObjectAttributes } from './legacy_types';

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyGetThrottleOptions = (
throttle: string | undefined | null = 'no_actions'
Expand All @@ -24,7 +24,7 @@ export const legacyGetThrottleOptions = (
});

/**
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
* @deprecated Once we are confident all rules relying on side-car actions SO's have been migrated to SO references we should remove this function
*/
export const legacyGetRuleActionsFromSavedObject = (
savedObject: SavedObjectsUpdateResponse<LegacyIRuleActionsAttributesSavedObjectAttributes>
Expand Down

0 comments on commit cdf4d81

Please sign in to comment.