[RAM] System actions update rule api#171099
Merged
guskovaue merged 16 commits intoelastic:system_actions_mvpfrom Nov 28, 2023
Merged
[RAM] System actions update rule api#171099guskovaue merged 16 commits intoelastic:system_actions_mvpfrom
guskovaue merged 16 commits intoelastic:system_actions_mvpfrom
Conversation
XavierM
reviewed
Nov 16, 2023
| ...rest | ||
| }) => ({ | ||
| }: PartialRule<RuleTypeParams>): Omit< | ||
| AsApiContract<PartialRule<RuleTypeParams> & { actions?: RuleResponseV1['actions'] }>, |
Contributor
There was a problem hiding this comment.
change to the latest and now versioning for now
Suggested change
| AsApiContract<PartialRule<RuleTypeParams> & { actions?: RuleResponseV1['actions'] }>, | |
| AsApiContract<PartialRule<RuleTypeParams> & { actions?: RuleResponse['actions'] }>, |
XavierM
reviewed
Nov 16, 2023
| }); | ||
|
|
||
| const rewriteBodyReq: RewriteRequestCase<UpdateOptions<RuleTypeParams>> = (result) => { | ||
| const rewriteBodyReq = ( |
Contributor
There was a problem hiding this comment.
just a little bit cleaner
type RuleBody = TypeOf<typeof bodySchema>;
interface RuleUpdateOptionsResult extends Omit<UpdateOptions<RuleTypeParams>, 'data'> {
data: RuleBody;
}
const rewriteBodyReq = (
result: RuleUpdateOptionsResult,
isSystemAction: (connectorId: string) => boolean
): UpdateOptions<RuleTypeParams> => {
const { notify_when: notifyWhen, actions, ...rest } = result.data;
return {
...result,
data: {
...rest,
notifyWhen,
actions: rewriteActionsReqWithSystemActions(actions, isSystemAction),
},
};
};
XavierM
approved these changes
Nov 16, 2023
Contributor
XavierM
left a comment
There was a problem hiding this comment.
Talked to @JiaweiWu about it since it is a work around since we did not migrate this route to versioning. We should add a note in the route file to let know the FUTURE ENGINEER why we did that and that we should change all the type to an update specific type.
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Contributor
|
Pinging @elastic/response-ops (Team:ResponseOps) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: #170831
Meta: #160367
Summary
This PR enables system actions for the Bulk Delete Rule API.