-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Alerting] Enable creating system actions through the Create Rule API #167884
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
@@ -181,9 +180,48 @@ export const monitoringSchema = schema.object({ | |||
}), | |||
}); | |||
|
|||
export const rRuleSchema = schema.object({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you decide to copy this schema instead of importing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a mistake when I resolved some conflicts with main
. Fixed in 71898c9
(#167884)
|
||
const data = { ...initialData, actions: addGeneratedActionValues(initialData.actions) }; | ||
const systemActions = initialData.actions.filter( | ||
(action): action is RuleSystemAction => action.type === RuleActionTypes.SYSTEM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use special function for this check, we can import from here?
x-pack/plugins/alerting/common/system_actions/is_system_action.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably some type issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct. The types of the createRule
are not compatible with this function. I tried but I could not make it work.
x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.ts
Show resolved
Hide resolved
@@ -13,7 +13,7 @@ import { | |||
} from '../../../lib'; | |||
import { BASE_ALERTING_API_PATH } from '../../../../types'; | |||
import { RouteOptions } from '../../..'; | |||
import type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you delete type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mistake. Fixed in 71898c9
(#167884)
x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.ts
Outdated
Show resolved
Hide resolved
@@ -47,8 +45,6 @@ export interface RulesClientFactoryOpts { | |||
minimumScheduleInterval: AlertingRulesConfig['minimumScheduleInterval']; | |||
maxScheduledPerMinute: AlertingRulesConfig['maxScheduledPerMinute']; | |||
connectorAdapterRegistry: ConnectorAdapterRegistry; | |||
getAlertIndicesAlias: GetAlertIndicesAlias; | |||
alertsService: AlertsService | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lost why did we delete these 2 methods from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again a mistake when fixing conflicts 🙂. Thanks! Fixed in 71898c9
(#167884)
…so_create_rule_api
…so_create_rule_api
…so_create_rule_api
…so_create_rule_api
This reverts commit 35153ca.
532a1c3
to
83f7167
Compare
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @cnasikas |
…API (#168226) Summarize your PR. If it involves visual changes include a screenshot or gif. Depends on: #167871, #167884 ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Julia Guskova <[email protected]>
Summary
This PR enables system actions only to the Create Rule API. Other PRs will follow on a subsequent PR.
Depends on: #167871
Related: #160367
Checklist
Delete any items that are not applicable to this PR.
For maintainers