Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Add skipped rules to Bulk Edit rules API response #147345

Merged
merged 12 commits into from
Dec 20, 2022
16 changes: 16 additions & 0 deletions x-pack/plugins/alerting/common/bulk_edit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { Rule } from './rule';

export type BulkEditSkipReason = 'RULE_NOT_MODIFIED';

export interface BulkActionSkipResult {
id: Rule['id'];
name?: Rule['name'];
skip_reason: BulkEditSkipReason;
}
1 change: 1 addition & 0 deletions x-pack/plugins/alerting/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export * from './rule_navigation';
export * from './alert_instance';
export * from './alert_summary';
export * from './builtin_action_groups';
export * from './bulk_edit';
export * from './disabled_action_groups';
export * from './rule_notify_when_type';
export * from './parse_duration';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('bulkEditInternalRulesRoute', () => {
},
],
};
const bulkEditResult = { rules: mockedAlerts, errors: [], total: 1 };
const bulkEditResult = { rules: mockedAlerts, errors: [], total: 1, skipped: [] };

it('bulk edits rules with tags action', async () => {
const licenseState = licenseStateMock.create();
Expand All @@ -97,6 +97,7 @@ describe('bulkEditInternalRulesRoute', () => {
body: {
total: 1,
errors: [],
skipped: [],
rules: [
expect.objectContaining({
id: '1',
Expand Down