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

[RAM][SECURITYSOLUTION][ALERTS] - Throw an error when user tries to set schedule interval shorter than any action frequency #156644

Merged

Conversation

e40pud
Copy link
Contributor

@e40pud e40pud commented May 4, 2023

Summary

These changes insure that alerting framework throws an exception when user tries to set rule's schedule interval shorter than one of the action frequencies.

The message will look like:

"message": "Error updating rule: the interval is longer than the action frequencies: 1h"

The UI changes will be addressed in the 8.9 in this ticket #155502

@e40pud e40pud added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Team:Detection Alerts Security Detection Alerts Area Team backport:prev-minor Backport to the previous minor version (i.e. one version back from main) ci:cloud-deploy Create or update a Cloud deployment labels May 4, 2023
@e40pud e40pud requested a review from XavierM May 4, 2023 07:54
@e40pud e40pud self-assigned this May 4, 2023
@e40pud e40pud requested a review from a team as a code owner May 4, 2023 07:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)


if (actionsWithInvalidThrottles.length > 0) {
throw Error(
`Error updating rule: the interval is longer than the action frequencies: ${actionsWithInvalidThrottles
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just add the ruleId and/or the ruleName in the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah, that would be more useful!

@e40pud
Copy link
Contributor Author

e40pud commented May 5, 2023

@elasticmachine merge upstream

@e40pud e40pud requested a review from XavierM May 5, 2023 15:33
@e40pud e40pud enabled auto-merge (squash) May 5, 2023 16:29
@e40pud
Copy link
Contributor Author

e40pud commented May 5, 2023

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented May 5, 2023

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
alerting 83 85 +2
enterpriseSearch 19 21 +2
securitySolution 398 401 +3
total +7

Total ESLint disabled count

id before after diff
alerting 85 87 +2
enterpriseSearch 20 22 +2
securitySolution 478 481 +3
total +7

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @e40pud

@e40pud e40pud merged commit e1ee019 into elastic:main May 5, 2023
18 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 5, 2023
…et schedule interval shorter than any action frequency (elastic#156644)

## Summary

These changes insure that alerting framework throws an exception when
user tries to set rule's schedule interval shorter than one of the
action frequencies.

The message will look like:

`"message": "Error updating rule: the interval is longer than the action
frequencies: 1h"`

TheUI changes will be addressed in the 8.9 in this ticket
elastic#155502

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit e1ee019)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 5, 2023
…s to set schedule interval shorter than any action frequency (#156644) (#156920)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[RAM][SECURITYSOLUTION][ALERTS] - Throw an error when user tries to
set schedule interval shorter than any action frequency
(#156644)](#156644)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2023-05-05T20:46:31Z","message":"[RAM][SECURITYSOLUTION][ALERTS]
- Throw an error when user tries to set schedule interval shorter than
any action frequency (#156644)\n\n## Summary\r\n\r\nThese changes insure
that alerting framework throws an exception when\r\nuser tries to set
rule's schedule interval shorter than one of the\r\naction
frequencies.\r\n\r\nThe message will look like:\r\n\r\n`\"message\":
\"Error updating rule: the interval is longer than the
action\r\nfrequencies: 1h\"`\r\n\r\nTheUI changes will be addressed in
the 8.9 in this
ticket\r\nhttps://github.com//issues/155502\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e1ee0196653a38fc6b7f8abfb191a286ad020176","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Team:Detection
Alerts","backport:prev-minor","ci:cloud-deploy","v8.9.0"],"number":156644,"url":"#156644
- Throw an error when user tries to set schedule interval shorter than
any action frequency (#156644)\n\n## Summary\r\n\r\nThese changes insure
that alerting framework throws an exception when\r\nuser tries to set
rule's schedule interval shorter than one of the\r\naction
frequencies.\r\n\r\nThe message will look like:\r\n\r\n`\"message\":
\"Error updating rule: the interval is longer than the
action\r\nfrequencies: 1h\"`\r\n\r\nTheUI changes will be addressed in
the 8.9 in this
ticket\r\nhttps://github.com//issues/155502\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e1ee0196653a38fc6b7f8abfb191a286ad020176"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"#156644
- Throw an error when user tries to set schedule interval shorter than
any action frequency (#156644)\n\n## Summary\r\n\r\nThese changes insure
that alerting framework throws an exception when\r\nuser tries to set
rule's schedule interval shorter than one of the\r\naction
frequencies.\r\n\r\nThe message will look like:\r\n\r\n`\"message\":
\"Error updating rule: the interval is longer than the
action\r\nfrequencies: 1h\"`\r\n\r\nTheUI changes will be addressed in
the 8.9 in this
ticket\r\nhttps://github.com//issues/155502\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e1ee0196653a38fc6b7f8abfb191a286ad020176"}}]}]
BACKPORT-->

Co-authored-by: Ievgen Sorokopud <ievgen.sorokopud@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to the previous minor version (i.e. one version back from main) ci:cloud-deploy Create or update a Cloud deployment release_note:skip Skip the PR/issue when compiling release notes Team:Detection Alerts Security Detection Alerts Area Team Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.8.0 v8.9.0
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants