Skip to content

Commit

Permalink
[8.x] [Response Ops][Flapping] Rule Specific Flapping - Create/Update…
Browse files Browse the repository at this point in the history
… API changes (elastic#190019) (elastic#195526)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Response Ops][Flapping] Rule Specific Flapping - Create/Update API
changes (elastic#190019)](elastic#190019)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Jiawei
Wu","email":"74562234+JiaweiWu@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-09T01:01:45Z","message":"[Response
Ops][Flapping] Rule Specific Flapping - Create/Update API changes
(elastic#190019)\n\n## Summary\r\nIssue:
https://github.com/elastic/kibana/issues/190018\r\n\r\nImplement rule
specific flapping support for create and update Rule API.\r\nThe new
property on the rule is named `flapping`;\r\n\r\n```\r\nflapping: {\r\n
look_back_window: number;\r\n status_change_threshold:
number;\r\n}\r\n```\r\n\r\nAlso make changes in the task runner to use
the rule's flapping settings\r\nif it exists. Otherwise use the global
flapping setting.\r\n\r\n# To test\r\n1. Go
to\r\n`x-pack/plugins/triggers_actions_ui/public/common/constants/index.ts`\r\nand
turn `IS_RULE_SPECIFIC_FLAPPING_ENABLED` to `true`\r\n2. Create a rule
with a rule specific flapping setting, generate the\r\nalert and let it
flap\r\n3. Assert that the flapping is now using the rule specific
flapping\r\n4. Turn space flapping off\r\n5. Assert that it no longer
flaps despite having a rule specific\r\nflapping\r\n6. Try
deleting/adding back the rule specific flapping via the UI and\r\nverify
everything works.\r\n\r\n### Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"edd61f63dbad99fe8da1e503c81db774fcb37e8f","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.16.0"],"title":"[Response
Ops][Flapping] Rule Specific Flapping - Create/Update API
changes","number":190019,"url":"https://github.com/elastic/kibana/pull/190019","mergeCommit":{"message":"[Response
Ops][Flapping] Rule Specific Flapping - Create/Update API changes
(elastic#190019)\n\n## Summary\r\nIssue:
https://github.com/elastic/kibana/issues/190018\r\n\r\nImplement rule
specific flapping support for create and update Rule API.\r\nThe new
property on the rule is named `flapping`;\r\n\r\n```\r\nflapping: {\r\n
look_back_window: number;\r\n status_change_threshold:
number;\r\n}\r\n```\r\n\r\nAlso make changes in the task runner to use
the rule's flapping settings\r\nif it exists. Otherwise use the global
flapping setting.\r\n\r\n# To test\r\n1. Go
to\r\n`x-pack/plugins/triggers_actions_ui/public/common/constants/index.ts`\r\nand
turn `IS_RULE_SPECIFIC_FLAPPING_ENABLED` to `true`\r\n2. Create a rule
with a rule specific flapping setting, generate the\r\nalert and let it
flap\r\n3. Assert that the flapping is now using the rule specific
flapping\r\n4. Turn space flapping off\r\n5. Assert that it no longer
flaps despite having a rule specific\r\nflapping\r\n6. Try
deleting/adding back the rule specific flapping via the UI and\r\nverify
everything works.\r\n\r\n### Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"edd61f63dbad99fe8da1e503c81db774fcb37e8f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/190019","number":190019,"mergeCommit":{"message":"[Response
Ops][Flapping] Rule Specific Flapping - Create/Update API changes
(elastic#190019)\n\n## Summary\r\nIssue:
https://github.com/elastic/kibana/issues/190018\r\n\r\nImplement rule
specific flapping support for create and update Rule API.\r\nThe new
property on the rule is named `flapping`;\r\n\r\n```\r\nflapping: {\r\n
look_back_window: number;\r\n status_change_threshold:
number;\r\n}\r\n```\r\n\r\nAlso make changes in the task runner to use
the rule's flapping settings\r\nif it exists. Otherwise use the global
flapping setting.\r\n\r\n# To test\r\n1. Go
to\r\n`x-pack/plugins/triggers_actions_ui/public/common/constants/index.ts`\r\nand
turn `IS_RULE_SPECIFIC_FLAPPING_ENABLED` to `true`\r\n2. Create a rule
with a rule specific flapping setting, generate the\r\nalert and let it
flap\r\n3. Assert that the flapping is now using the rule specific
flapping\r\n4. Turn space flapping off\r\n5. Assert that it no longer
flaps despite having a rule specific\r\nflapping\r\n6. Try
deleting/adding back the rule specific flapping via the UI and\r\nverify
everything works.\r\n\r\n### Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"edd61f63dbad99fe8da1e503c81db774fcb37e8f"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jiawei Wu <74562234+JiaweiWu@users.noreply.github.com>
  • Loading branch information
kibanamachine and JiaweiWu authored Oct 9, 2024
1 parent 25132be commit 8f9f106
Show file tree
Hide file tree
Showing 80 changed files with 2,108 additions and 74 deletions.
126 changes: 126 additions & 0 deletions oas_docs/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"id": {
"description": "The identifier for the rule.",
"type": "string"
Expand Down Expand Up @@ -2667,6 +2688,27 @@
"description": "Indicates whether you want to run the rule on an interval basis after it is created.",
"type": "boolean"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"name": {
"description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.",
"type": "string"
Expand Down Expand Up @@ -3047,6 +3089,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"id": {
"description": "The identifier for the rule.",
"type": "string"
Expand Down Expand Up @@ -3853,6 +3916,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"name": {
"description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.",
"type": "string"
Expand Down Expand Up @@ -4226,6 +4310,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"id": {
"description": "The identifier for the rule.",
"type": "string"
Expand Down Expand Up @@ -5692,6 +5797,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"id": {
"description": "The identifier for the rule.",
"type": "string"
Expand Down
126 changes: 126 additions & 0 deletions oas_docs/bundle.serverless.json
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"id": {
"description": "The identifier for the rule.",
"type": "string"
Expand Down Expand Up @@ -2667,6 +2688,27 @@
"description": "Indicates whether you want to run the rule on an interval basis after it is created.",
"type": "boolean"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"name": {
"description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.",
"type": "string"
Expand Down Expand Up @@ -3047,6 +3089,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"id": {
"description": "The identifier for the rule.",
"type": "string"
Expand Down Expand Up @@ -3853,6 +3916,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"name": {
"description": "The name of the rule. While this name does not have to be unique, a distinctive name can help you identify a rule.",
"type": "string"
Expand Down Expand Up @@ -4226,6 +4310,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"id": {
"description": "The identifier for the rule.",
"type": "string"
Expand Down Expand Up @@ -5692,6 +5797,27 @@
],
"type": "object"
},
"flapping": {
"additionalProperties": false,
"nullable": true,
"properties": {
"look_back_window": {
"maximum": 20,
"minimum": 2,
"type": "number"
},
"status_change_threshold": {
"maximum": 20,
"minimum": 2,
"type": "number"
}
},
"required": [
"look_back_window",
"status_change_threshold"
],
"type": "object"
},
"id": {
"description": "The identifier for the rule.",
"type": "string"
Expand Down
Loading

0 comments on commit 8f9f106

Please sign in to comment.