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

[Alerting] Enable creating system actions through the Create Rule API #167884

Merged
merged 29 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b310c8a
Support system actions in the create rule API
cnasikas Oct 3, 2023
6ec30eb
Init system action types
cnasikas Oct 3, 2023
40306ce
Create isSystemAction helper
cnasikas Oct 3, 2023
0fab8a8
Use the isSystemAction helper in the executor
cnasikas Oct 3, 2023
5024714
Pass the isSystemAction to the rules factory
cnasikas Oct 3, 2023
3bda9b9
Add test utils for system actions
cnasikas Oct 3, 2023
9fb4ab9
Merge branch 'sa_executor_types' into so_create_rule_api
cnasikas Oct 3, 2023
d68f1cb
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 3, 2023
f9dccc5
Do not persist the type of the action in ES
cnasikas Oct 6, 2023
54fd67a
Merge branch 'system_actions_mvp' into sa_executor_types
cnasikas Oct 6, 2023
2fe3842
Merge branch 'sa_executor_types' into so_create_rule_api
cnasikas Oct 6, 2023
3957566
Add integration test
cnasikas Oct 6, 2023
b1791ec
Merge branch 'system_actions_mvp' into so_create_rule_api
guskovaue Oct 19, 2023
35153ca
devide system actions validation into 2 functions
guskovaue Oct 24, 2023
e19b504
Merge branch 'so_create_rule_api' of github.com:cnasikas/kibana into …
guskovaue Oct 24, 2023
c6a4bf0
make transform functions not async
guskovaue Oct 24, 2023
bc6d4c2
Merge branch 'system_actions_mvp' into so_create_rule_api
cnasikas Oct 24, 2023
8b04811
Merge branch 'so_create_rule_api' of github.com:cnasikas/kibana into …
cnasikas Oct 24, 2023
71898c9
Address PR feedback
cnasikas Oct 24, 2023
d886bfc
fix tests after changes
guskovaue Oct 24, 2023
4851d79
Merge branch 'so_create_rule_api' of github.com:cnasikas/kibana into …
guskovaue Oct 24, 2023
4a3867e
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 24, 2023
cb5a00b
fix actions client mock for create rule route tests
guskovaue Oct 25, 2023
7d1faae
Merge branch 'so_create_rule_api' of github.com:cnasikas/kibana into …
guskovaue Oct 25, 2023
4a89ae2
fix types after merging
guskovaue Oct 25, 2023
eac2411
fix integrational tests
guskovaue Oct 25, 2023
cce69c0
Revert "devide system actions validation into 2 functions"
guskovaue Oct 25, 2023
83f7167
fix tests after validate system actions revert
guskovaue Oct 25, 2023
a278ccc
fix integrational tests
guskovaue Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export class ActionsClient {
/**
* Get all system connectors
*/
public async getAllSystemConnectors(): Promise<FindConnectorResult[]> {
public async getAllSystemConnectors(): Promise<ConnectorWithExtraFindData[]> {
return getAllSystemConnectors({ context: this.context });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function getAllSystemConnectors({
context,
}: {
context: GetAllParams['context'];
}): Promise<FindConnectorResult[]> {
}): Promise<ConnectorWithExtraFindData[]> {
try {
await context.authorization.ensureAuthorized({ operation: 'get' });
} catch (error) {
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/actions/server/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ import {
} from '@kbn/core/server/mocks';
import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks';
import { Logger } from '@kbn/core/server';
import { actionsClientMock } from './actions_client/actions_client.mock';
import { actionsClientMock, ActionsClientMock } from './actions_client/actions_client.mock';
import { PluginSetupContract, PluginStartContract, renderActionParameterTemplates } from './plugin';
import { Services } from './types';
import { actionsAuthorizationMock } from './authorization/actions_authorization.mock';
import { ConnectorTokenClient } from './lib/connector_token_client';
import { unsecuredActionsClientMock } from './unsecured_actions_client/unsecured_actions_client.mock';
export { actionsAuthorizationMock };
export { actionsClientMock };
export type { ActionsClientMock };

const logger = loggingSystemMock.create().get() as jest.Mocked<Logger>;

const createSetupMock = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const actionAlertsFilterSchema = schema.object({

export const actionSchema = schema.object({
uuid: schema.maybe(schema.string()),
group: schema.string(),
group: schema.maybe(schema.string()),
id: schema.string(),
actionTypeId: schema.maybe(schema.string()),
params: schema.recordOf(schema.string(), schema.maybe(schema.any()), { defaultValue: {} }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const actionAlertsFilterSchema = schema.object({

const actionSchema = schema.object({
uuid: schema.maybe(schema.string()),
group: schema.string(),
group: schema.maybe(schema.string()),
id: schema.string(),
connector_type_id: schema.string(),
params: actionParamsSchema,
Expand Down
Loading
Loading