-
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
[Response Ops][Flapping] Rule Specific Flapping - Create/Update API changes #190019
[Response Ops][Flapping] Rule Specific Flapping - Create/Update API changes #190019
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
@elasticmachine merge upstream |
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --update'
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.
Tested locally, rule level flapping settings overwrites the global settings if it is enabled
@elasticmachine merge upstream |
… src/core/server/integration_tests/ci_checks'
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.
The alert saved object hash changed without a new model version. Are you sure the changes are stable for BWC?
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.
If you're sure no new model version is needed for the change to the SO, then LGTM
@TinaHeiligers Actually I'm not too familiar with how we're dealing with adding new properties to saved objects. So in this PR I'm adding a new un-indexed property to the rule saved object. The property is called
Here is the commit where I add the new version with the new schema: 99f0926 But please let me know if I missed anything! Thanks! |
If there isn't a mappings change and the new field isn't in the raw ES doc (it can be in |
Yes, it will be used in the UI. By model version, do you just mean what I have added in this commit: 99f0926#diff-12c3ecfb676c8d71cfbd3ca6e4ce29223604dfa58d35a3a108ee6399da34f8daR19 Haha sorry for the dumb question. |
… src/core/server/integration_tests/ci_checks'
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
## Summary This PR implements the `forwardCompatibility` field for the rule model version in preparation for the flapping PR (#190019). We're doing this so we have the point to revert back to if we need to where the `forwardCompatibility` is defined. --------- Co-authored-by: kibanamachine <[email protected]>
## Summary This PR implements the `forwardCompatibility` field for the rule model version in preparation for the flapping PR (elastic#190019). We're doing this so we have the point to revert back to if we need to where the `forwardCompatibility` is defined. --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit bb18996)
… (#193695) # Backport This will backport the following commits from `main` to `8.x`: - [[Response Ops][Rules] Rule Model Version Forward Compat (#193233)](#193233) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jiawei Wu","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-20T08:50:54Z","message":"[Response Ops][Rules] Rule Model Version Forward Compat (#193233)\n\n## Summary\r\n\r\nThis PR implements the `forwardCompatibility` field for the rule model\r\nversion in preparation for the flapping PR\r\n(#190019). We're doing this so we\r\nhave the point to revert back to if we need to where the\r\n`forwardCompatibility` is defined.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"bb1899653f6fc077d443a600bce6c6f2fc775964","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][Rules] Rule Model Version Forward Compat","number":193233,"url":"https://github.com/elastic/kibana/pull/193233","mergeCommit":{"message":"[Response Ops][Rules] Rule Model Version Forward Compat (#193233)\n\n## Summary\r\n\r\nThis PR implements the `forwardCompatibility` field for the rule model\r\nversion in preparation for the flapping PR\r\n(#190019). We're doing this so we\r\nhave the point to revert back to if we need to where the\r\n`forwardCompatibility` is defined.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"bb1899653f6fc077d443a600bce6c6f2fc775964"}},"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/193233","number":193233,"mergeCommit":{"message":"[Response Ops][Rules] Rule Model Version Forward Compat (#193233)\n\n## Summary\r\n\r\nThis PR implements the `forwardCompatibility` field for the rule model\r\nversion in preparation for the flapping PR\r\n(#190019). We're doing this so we\r\nhave the point to revert back to if we need to where the\r\n`forwardCompatibility` is defined.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"bb1899653f6fc077d443a600bce6c6f2fc775964"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jiawei Wu <[email protected]>
… src/core/server/integration_tests/ci_checks'
@elasticmachine merge upstream |
💔 Build Failed
Failed CI StepsMetrics [docs]
History
|
@elasticmachine merge upstream |
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11246278567 |
…hanges (elastic#190019) ## Summary Issue: elastic#190018 Implement rule specific flapping support for create and update Rule API. The new property on the rule is named `flapping`; ``` flapping: { look_back_window: number; status_change_threshold: number; } ``` Also make changes in the task runner to use the rule's flapping settings if it exists. Otherwise use the global flapping setting. # To test 1. Go to `x-pack/plugins/triggers_actions_ui/public/common/constants/index.ts` and turn `IS_RULE_SPECIFIC_FLAPPING_ENABLED` to `true` 2. Create a rule with a rule specific flapping setting, generate the alert and let it flap 3. Assert that the flapping is now using the rule specific flapping 4. Turn space flapping off 5. Assert that it no longer flaps despite having a rule specific flapping 6. Try deleting/adding back the rule specific flapping via the UI and verify everything works. ### Checklist - [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 --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit edd61f6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… API changes (#190019) (#195526) # Backport This will backport the following commits from `main` to `8.x`: - [[Response Ops][Flapping] Rule Specific Flapping - Create/Update API changes (#190019)](#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":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-09T01:01:45Z","message":"[Response Ops][Flapping] Rule Specific Flapping - Create/Update API changes (#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 <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","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 (#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 <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","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 (#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 <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"edd61f63dbad99fe8da1e503c81db774fcb37e8f"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jiawei Wu <[email protected]>
Summary
Issue: #190018
Implement rule specific flapping support for create and update Rule API. The new property on the rule is named
flapping
;Also make changes in the task runner to use the rule's flapping settings if it exists. Otherwise use the global flapping setting.
To test
x-pack/plugins/triggers_actions_ui/public/common/constants/index.ts
and turnIS_RULE_SPECIFIC_FLAPPING_ENABLED
totrue
Checklist