-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[System Actions] Complete API audit and update APIs to comply with System Actions #172937
[System Actions] Complete API audit and update APIs to comply with System Actions #172937
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/response-ops (Team:ResponseOps) |
return { | ||
id: action.id, | ||
params: action.params, | ||
...(typeof useAlertDataForTemplate !== 'undefined' ? { useAlertDataForTemplate } : {}), | ||
...(action.uuid ? { uuid: action.uuid } : {}), | ||
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.
Let's write some unit tests for this
})), | ||
actions: actions.map( | ||
({ id, actionTypeId, params, uuid, type, useAlertDataForTemplate, ...action }) => { | ||
if (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.
Let's write some unit tests for this as well
@@ -146,15 +146,13 @@ export const updateRuleRoute = ( | |||
router.handleLegacyErrors( | |||
verifyAccessAndContext(licenseState, async function (context, req, res) { | |||
const rulesClient = (await context.alerting).getRulesClient(); | |||
const actionsClient = (await context.actions).getActionsClient(); | |||
const { isSystemAction } = (await context.actions).getActionsClient(); |
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.
Do we have E2E test cases to assert the correct output for these endpoints?
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.
💔 Build FailedFailed CI Steps
Metrics [docs]
HistoryTo update your PR or re-run it, just comment with: |
@JiaweiWu ready for review Note that CI is failing because we're pushing to a feature branch and it can't seem to find the build |
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.
LGTM
Summary
Closes #172168
This updates the legacy
rewriteActionsReq
andrewriteRule
transforms to be compatible with System Actions, and replaces all uses of legacyrewriteActionsRes
withtransformRuleActions
, which is already System Actions-compliant.Affected APIs are:
_clone
_find
_get
_update