-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Not selecting any days in alerts filter maps to all weekdays #156913
Not selecting any days in alerts filter maps to all weekdays #156913
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
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, small export nit
import { AlertHit, SummarizedAlerts } from '@kbn/alerting-plugin/server/types'; | ||
import { ParsedTechnicalFields } from '../../common'; | ||
import { ParsedExperimentalFields } from '../../common/parse_experimental_fields'; | ||
import { IRuleDataClient, IRuleDataReader } from '../rule_data_client'; | ||
|
||
const MAX_ALERT_DOCS_TO_RETURN = 100; | ||
export const ISO_WEEKDAYS: IsoWeekday[] = [1, 2, 3, 4, 5, 6, 7]; |
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.
Already exported from @kbn/triggers-actions-ui-plugin/common/constants
, but probably should be exported from alerting-plugin
. Can you move this there?
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.
AO changes LGTM
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @ersin-erdal |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…#156913) Fixes: elastic#156878 As discussed in the issue just turning `if alert is generated within timeframe` on should not change the filter scope. And the UI should not confuse the users by setting some days as default. And as discussed in elastic#154680, default hours filter should cover the whole day. Therefore, this PR sets default alerts filter options as: ``` { days: [], hours: { start: '00:00', end: '00:00', }, }; ``` empty days array maps to all weekdays `[1,2,3,4,5,6,7]` and hours `00:00 -> 00:00` maps to `00:00 -> 24:00` (cherry picked from commit d157389) # Conflicts: # x-pack/plugins/rule_registry/server/utils/create_get_summarized_alerts_fn.ts
…156913) (#157211) # Backport This will backport the following commits from `main` to `8.8`: - [Not selecting any days in alerts filter maps to all weekdays (#156913)](#156913) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ersin Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-05-09T15:29:14Z","message":"Not selecting any days in alerts filter maps to all weekdays (#156913)\n\nFixes: #156878\r\n\r\nAs discussed in the issue just turning `if alert is generated within\r\ntimeframe` on should not change the filter scope.\r\nAnd the UI should not confuse the users by setting some days as default.\r\n\r\nAnd as discussed in #154680, default hours filter should cover the whole\r\nday.\r\n\r\nTherefore, this PR sets default alerts filter options as:\r\n```\r\n {\r\n days: [],\r\n hours: {\r\n start: '00:00',\r\n end: '00:00',\r\n },\r\n };\r\n```\r\n\r\nempty days array maps to all weekdays `[1,2,3,4,5,6,7]`\r\nand hours `00:00 -> 00:00` maps to `00:00 -> 24:00`","sha":"d15738989a6544c9b939cde5afc3533c9850d7d4","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v8.8.0","v8.9.0"],"number":156913,"url":"https://github.com/elastic/kibana/pull/156913","mergeCommit":{"message":"Not selecting any days in alerts filter maps to all weekdays (#156913)\n\nFixes: #156878\r\n\r\nAs discussed in the issue just turning `if alert is generated within\r\ntimeframe` on should not change the filter scope.\r\nAnd the UI should not confuse the users by setting some days as default.\r\n\r\nAnd as discussed in #154680, default hours filter should cover the whole\r\nday.\r\n\r\nTherefore, this PR sets default alerts filter options as:\r\n```\r\n {\r\n days: [],\r\n hours: {\r\n start: '00:00',\r\n end: '00:00',\r\n },\r\n };\r\n```\r\n\r\nempty days array maps to all weekdays `[1,2,3,4,5,6,7]`\r\nand hours `00:00 -> 00:00` maps to `00:00 -> 24:00`","sha":"d15738989a6544c9b939cde5afc3533c9850d7d4"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156913","number":156913,"mergeCommit":{"message":"Not selecting any days in alerts filter maps to all weekdays (#156913)\n\nFixes: #156878\r\n\r\nAs discussed in the issue just turning `if alert is generated within\r\ntimeframe` on should not change the filter scope.\r\nAnd the UI should not confuse the users by setting some days as default.\r\n\r\nAnd as discussed in #154680, default hours filter should cover the whole\r\nday.\r\n\r\nTherefore, this PR sets default alerts filter options as:\r\n```\r\n {\r\n days: [],\r\n hours: {\r\n start: '00:00',\r\n end: '00:00',\r\n },\r\n };\r\n```\r\n\r\nempty days array maps to all weekdays `[1,2,3,4,5,6,7]`\r\nand hours `00:00 -> 00:00` maps to `00:00 -> 24:00`","sha":"d15738989a6544c9b939cde5afc3533c9850d7d4"}}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Fixes: #156878
As discussed in the issue just turning
if alert is generated within timeframe
on should not change the filter scope.And the UI should not confuse the users by setting some days as default.
And as discussed in #154680, default hours filter should cover the whole day.
Therefore, this PR sets default alerts filter options as:
empty days array maps to all weekdays
[1,2,3,4,5,6,7]
and hours
00:00 -> 00:00
maps to00:00 -> 24:00