[Cases] Register connector adapter#179796
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
|
Pinging @elastic/response-ops-cases (Feature:Cases) |
|
Sorry for the noise! |
| id: `system-connector-${systemActionType.id}`, | ||
| actionTypeId: systemActionType.id, | ||
| name: `System action: ${systemActionType.id}`, | ||
| name: systemActionType.name, |
There was a problem hiding this comment.
The name of a system connector will be the same name as the action type name. This change affected some tests.
| import { OWNER_INFO } from './owners'; | ||
|
|
||
| describe('OWNER_INFO', () => { | ||
| it('should use all available rule consumers', () => { |
There was a problem hiding this comment.
If a new consumer is added the test will fail and we will get notified.
| ActionParamsProps<CasesActionParams> | ||
| > = ({ actionParams, editAction, errors, index, producerId }) => { | ||
| const { appId } = useApplication(); | ||
| const owner = getCaseOwnerByAppId(appId); |
There was a problem hiding this comment.
The owner will be automatically mapped in the connector adapter.
| auth?: { user: User; space: string | null }; | ||
| }): Promise<ActionTypeExecutorResult<unknown>> => { | ||
| const { body: res } = await supertest | ||
| .post(`${getSpaceUrlPrefix(auth.space)}/api/cases_fixture/${connectorId}/connectors:execute`) |
There was a problem hiding this comment.
I had to create a new route for executing system actions only for testing because the public execute API does not allow the execution of system actions.
| iconType: 'logoObservability', | ||
| appRoute: '/app/observability', | ||
| validRuleConsumers: [ | ||
| // only valid in serverless |
There was a problem hiding this comment.
Should there be separate list of validRuleConsumers for serverless and ESS?
There was a problem hiding this comment.
In both deployments, a valid consumer will be found in the validRuleConsumers array so there is no need to separate the list. If we separate it into two lists we will have to add logic to check if we are in serverless or ESS which will increase the complexity of the code.
| "cases" | ||
| ], | ||
| "requiredPlugins": [ | ||
| "alerting", |
There was a problem hiding this comment.
Ohh.. I wonder how UI worked without this 🤔
There was a problem hiding this comment.
The UI is in the triggers_actions_ui plugin. The alerting plugin is used to register the connector adapter.
| return validationResult; | ||
| }, | ||
| actionParamsFields: lazy(() => import('./cases_params')), | ||
| isSystemActionType: true, |
| */ | ||
| const filteredAlerts = alerts.filter((alert) => | ||
| uniqueGroupingByFields.every((groupingByField) => Object.hasOwn(alert, groupingByField)) | ||
| uniqueGroupingByFields.every((groupingByField) => Boolean(get(alert, groupingByField, null))) |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @cnasikas |
Summary
Now that the system actions PR is merged (#166267) we can use the connector adapters to transform the case action params. This PR:
Checklist
Delete any items that are not applicable to this PR.
For maintainers