Skip to content

Commit cdf4d81

Browse files
Updated deprecation message per PR comments
1 parent db725c0 commit cdf4d81

18 files changed

+39
-51
lines changed

x-pack/plugins/security_solution/common/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export const THRESHOLD_RULE_TYPE_ID = `${RULE_TYPE_PREFIX}.thresholdRule` as con
202202

203203
/**
204204
* Id for the notifications alerting type
205-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
205+
* @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
206206
*/
207207
export const LEGACY_NOTIFICATIONS_ID = `siem.notifications`;
208208

x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_add_tags.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { INTERNAL_RULE_ALERT_ID_KEY } from '../../../../common/constants';
99

1010
/**
11-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
11+
* @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
1212
*/
1313
export const legacyAddTags = (tags: string[], ruleAlertId: string): string[] =>
1414
Array.from(new Set([...tags, `${INTERNAL_RULE_ALERT_ID_KEY}:${ruleAlertId}`]));

x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_create_notifications.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { rulesClientMock } from '../../../../../alerting/server/mocks';
1010
import { legacyCreateNotifications } from './legacy_create_notifications';
1111

1212
/**
13-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
13+
* @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
1414
*/
1515
describe('legacyCreateNotifications', () => {
1616
let rulesClient: ReturnType<typeof rulesClientMock.create>;

x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_create_notifications.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { CreateNotificationParams, LegacyRuleNotificationAlertTypeParams } from
1313
import { legacyAddTags } from './legacy_add_tags';
1414

1515
/**
16-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
16+
* @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
1717
*/
1818
export const legacyCreateNotifications = async ({
1919
rulesClient,

x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_find_notifications.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { LEGACY_NOTIFICATIONS_ID } from '../../../../common/constants';
1111
import { LegacyFindNotificationParams } from './legacy_types';
1212

1313
/**
14-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
14+
* @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
1515
*/
1616
export const legacyGetFilter = (filter: string | null | undefined) => {
1717
if (filter == null) {
@@ -22,7 +22,7 @@ export const legacyGetFilter = (filter: string | null | undefined) => {
2222
};
2323

2424
/**
25-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
25+
* @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
2626
*/
2727
export const legacyFindNotifications = async ({
2828
rulesClient,

x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_read_notifications.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { legacyFindNotifications } from './legacy_find_notifications';
1313
import { INTERNAL_RULE_ALERT_ID_KEY } from '../../../../common/constants';
1414

1515
/**
16-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
16+
* @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
1717
*/
1818
export const legacyReadNotifications = async ({
1919
rulesClient,

x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_rules_notification_alert_type.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { getQueryRuleParams } from '../schemas/rule_schemas.mock';
2525
jest.mock('./build_signals_query');
2626

2727
/**
28-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
28+
* @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
2929
*/
3030
describe('legacyRules_notification_alert_type', () => {
3131
let payload: LegacyNotificationExecutorOptions;

x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_rules_notification_alert_type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { getNotificationResultsLink } from './utils';
2323
import { getSignals } from './get_signals';
2424

2525
/**
26-
* @deprecated Once legacy notifications/"side car actions" goes away this should also be removed
26+
* @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
2727
*/
2828
export const legacyRulesNotificationAlertType = ({
2929
logger,

x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_types.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ import { Alert, AlertAction } from '../../../../../alerting/common';
1919
import { LEGACY_NOTIFICATIONS_ID } from '../../../../common/constants';
2020

2121
/**
22-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
22+
* @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
2323
*/
2424
export interface LegacyRuleNotificationAlertTypeParams extends AlertTypeParams {
2525
ruleAlertId: string;
2626
}
2727

2828
/**
29-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
29+
* @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
3030
*/
3131
export type LegacyRuleNotificationAlertType = Alert<LegacyRuleNotificationAlertTypeParams>;
3232

3333
/**
34-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
34+
* @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
3535
*/
3636
export interface LegacyFindNotificationParams {
3737
rulesClient: RulesClient;
@@ -44,14 +44,14 @@ export interface LegacyFindNotificationParams {
4444
}
4545

4646
/**
47-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
47+
* @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
4848
*/
4949
export interface LegacyClients {
5050
rulesClient: RulesClient;
5151
}
5252

5353
/**
54-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
54+
* @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
5555
*/
5656
export interface LegacyNotificationAlertParams {
5757
actions: AlertAction[];
@@ -62,12 +62,12 @@ export interface LegacyNotificationAlertParams {
6262
}
6363

6464
/**
65-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
65+
* @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
6666
*/
6767
export type CreateNotificationParams = LegacyNotificationAlertParams & LegacyClients;
6868

6969
/**
70-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
70+
* @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
7171
*/
7272
export interface LegacyReadNotificationParams {
7373
rulesClient: RulesClient;
@@ -76,7 +76,7 @@ export interface LegacyReadNotificationParams {
7676
}
7777

7878
/**
79-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
79+
* @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
8080
*/
8181
export const legacyIsAlertType = (
8282
partialAlert: PartialAlert<AlertTypeParams>
@@ -85,7 +85,7 @@ export const legacyIsAlertType = (
8585
};
8686

8787
/**
88-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
88+
* @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
8989
*/
9090
export type LegacyNotificationExecutorOptions = AlertExecutorOptions<
9191
LegacyRuleNotificationAlertTypeParams,
@@ -97,7 +97,7 @@ export type LegacyNotificationExecutorOptions = AlertExecutorOptions<
9797
/**
9898
* This returns true because by default a NotificationAlertTypeDefinition is an AlertType
9999
* since we are only increasing the strictness of params.
100-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
100+
* @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
101101
*/
102102
export const legacyIsNotificationAlertExecutor = (
103103
obj: LegacyNotificationAlertTypeDefinition
@@ -112,7 +112,7 @@ export const legacyIsNotificationAlertExecutor = (
112112
};
113113

114114
/**
115-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
115+
* @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
116116
*/
117117
export type LegacyNotificationAlertTypeDefinition = Omit<
118118
AlertType<

x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ export const getSignalsMigrationStatusRequest = () =>
597597
});
598598

599599
/**
600-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
600+
* @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
601601
*/
602602
export const legacyGetNotificationResult = (): LegacyRuleNotificationAlertType => ({
603603
id: '200dbf2f-b269-4bf9-aa85-11ba32ba73ba',
@@ -641,7 +641,7 @@ export const legacyGetNotificationResult = (): LegacyRuleNotificationAlertType =
641641
});
642642

643643
/**
644-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
644+
* @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
645645
*/
646646
export const legacyGetFindNotificationsResultWithSingleHit =
647647
(): FindHit<LegacyRuleNotificationAlertType> => ({

x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/legacy_create_rule_actions_saved_object.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { AlertAction } from '../../../../../alerting/common';
1818
import { transformAlertToRuleAction } from '../../../../common/detection_engine/transform_actions';
1919

2020
/**
21-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
21+
* @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
2222
*/
2323
interface LegacyCreateRuleActionsSavedObject {
2424
ruleAlertId: string;
@@ -28,7 +28,7 @@ interface LegacyCreateRuleActionsSavedObject {
2828
}
2929

3030
/**
31-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
31+
* @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
3232
*/
3333
export const legacyCreateRuleActionsSavedObject = async ({
3434
ruleAlertId,

x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/legacy_get_bulk_rule_actions_saved_object.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import { LegacyRulesActionsSavedObject } from './legacy_get_rule_actions_saved_o
1717
import { buildChunkedOrFilter } from '../signals/utils';
1818

1919
/**
20-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
20+
* @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
2121
*/
2222
interface LegacyGetBulkRuleActionsSavedObject {
2323
alertIds: string[];
2424
savedObjectsClient: AlertServices['savedObjectsClient'];
2525
}
2626

2727
/**
28-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
28+
* @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
2929
*/
3030
export const legacyGetBulkRuleActionsSavedObject = async ({
3131
alertIds,

x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/legacy_get_rule_actions_saved_object.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ import { LegacyIRuleActionsAttributesSavedObjectAttributes } from './legacy_type
1515
import { legacyGetRuleActionsFromSavedObject } from './legacy_utils';
1616

1717
/**
18-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
18+
* @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
1919
*/
2020
interface LegacyGetRuleActionsSavedObject {
2121
ruleAlertId: string;
2222
savedObjectsClient: AlertServices['savedObjectsClient'];
2323
}
2424

2525
/**
26-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
26+
* @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
2727
*/
2828
export interface LegacyRulesActionsSavedObject {
2929
id: string;
@@ -33,7 +33,7 @@ export interface LegacyRulesActionsSavedObject {
3333
}
3434

3535
/**
36-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
36+
* @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
3737
*/
3838
export const legacyGetRuleActionsSavedObject = async ({
3939
ruleAlertId,

x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/legacy_migrations.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ import {
1515
import { LegacyIRuleActionsAttributesSavedObjectAttributes } from './legacy_types';
1616

1717
/**
18-
* We keep this around to migrate and update data for the old deprecated rule actions saved object mapping but we
19-
* do not use it anymore within the code base. Once we feel comfortable that users are upgrade far enough and this is no longer
20-
* needed then it will be safe to remove this saved object and all its migrations
21-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
18+
* @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
2219
*/
2320
function isEmptyObject(obj: {}) {
2421
for (const attr in obj) {
@@ -30,10 +27,7 @@ function isEmptyObject(obj: {}) {
3027
}
3128

3229
/**
33-
* We keep this around to migrate and update data for the old deprecated rule actions saved object mapping but we
34-
* do not use it anymore within the code base. Once we feel comfortable that users are upgrade far enough and this is no longer
35-
* needed then it will be safe to remove this saved object and all its migrations
36-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
30+
* @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
3731
*/
3832
export const legacyRuleActionsSavedObjectMigration = {
3933
'7.11.2': (

x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/legacy_saved_object_mappings.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,12 @@ import { SavedObjectsType } from '../../../../../../../src/core/server';
1010
import { legacyRuleActionsSavedObjectMigration } from './legacy_migrations';
1111

1212
/**
13-
* We keep this around to migrate and update data for the old deprecated rule actions saved object mapping but we
14-
* do not use it anymore within the code base. Once we feel comfortable that users are upgrade far enough and this is no longer
15-
* needed then it will be safe to remove this saved object and all its migrations.
16-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
13+
* @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
1714
*/
1815
export const legacyRuleActionsSavedObjectType = 'siem-detection-engine-rule-actions';
1916

2017
/**
21-
* We keep this around to migrate and update data for the old deprecated rule actions saved object mapping but we
22-
* do not use it anymore within the code base. Once we feel comfortable that users are upgrade far enough and this is no longer
23-
* needed then it will be safe to remove this saved object and all its migrations.
24-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
18+
* @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
2519
*/
2620
const legacyRuleActionsSavedObjectMappings: SavedObjectsType['mappings'] = {
2721
properties: {

x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/legacy_update_or_create_rule_actions_saved_object.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { legacyUpdateRuleActionsSavedObject } from './legacy_update_rule_actions
1717
import { LegacyRuleActions } from './legacy_types';
1818

1919
/**
20-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
20+
* @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
2121
*/
2222
interface LegacyUpdateOrCreateRuleActionsSavedObject {
2323
ruleAlertId: string;
@@ -27,7 +27,7 @@ interface LegacyUpdateOrCreateRuleActionsSavedObject {
2727
}
2828

2929
/**
30-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
30+
* @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
3131
*/
3232
export const legacyUpdateOrCreateRuleActionsSavedObject = async ({
3333
savedObjectsClient,

x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/legacy_update_rule_actions_saved_object.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { AlertAction } from '../../../../../alerting/common';
1818
import { transformAlertToRuleAction } from '../../../../common/detection_engine/transform_actions';
1919

2020
/**
21-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
21+
* @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
2222
*/
2323
interface LegacyUpdateRuleActionsSavedObject {
2424
ruleAlertId: string;
@@ -29,7 +29,7 @@ interface LegacyUpdateRuleActionsSavedObject {
2929
}
3030

3131
/**
32-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
32+
* @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
3333
*/
3434
export const legacyUpdateRuleActionsSavedObject = async ({
3535
ruleAlertId,

x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/legacy_utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { RuleAlertAction } from '../../../../common/detection_engine/types';
1111
import { LegacyIRuleActionsAttributesSavedObjectAttributes } from './legacy_types';
1212

1313
/**
14-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
14+
* @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
1515
*/
1616
export const legacyGetThrottleOptions = (
1717
throttle: string | undefined | null = 'no_actions'
@@ -24,7 +24,7 @@ export const legacyGetThrottleOptions = (
2424
});
2525

2626
/**
27-
* @deprecated Once legacy notifications/"side car actions" goes away this should be removed
27+
* @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
2828
*/
2929
export const legacyGetRuleActionsFromSavedObject = (
3030
savedObject: SavedObjectsUpdateResponse<LegacyIRuleActionsAttributesSavedObjectAttributes>

0 commit comments

Comments
 (0)