-
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
[ResponseOps][MW] Fix bug when creating repeating Maintenance Window #207084
Conversation
The maintenance window client now uses the schema from common. No more duplication. Tests.
Pinging @elastic/response-ops (Team:ResponseOps) |
* 2.0. | ||
*/ | ||
|
||
export const validateRecurrenceByWeekday = (array: string[]) => { |
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.
It might make sense to move this to the rule package
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.
agree
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.
Don't see the error anymore 👍 Have a query about regex.
* 2.0. | ||
*/ | ||
|
||
export const validateRecurrenceByWeekday = (array: string[]) => { |
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.
agree
return 'rRule byweekday cannot be empty'; | ||
} | ||
|
||
const byWeekDayRegex = new RegExp('^(((\\+|-)[1-4])?(MO|TU|WE|TH|FR|SA|SU))$'); |
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.
wow 😅 why only 1-4
, what if there are 5 Mondays in a month?
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.
Looking into the iCalendar RRULE spec the ByWeekday syntax is actually completely non-standard, it's a holdover from the original RRule library's basis on python-dateutil
Spec-compliant syntax definitely does support "5th Monday of the month" but it supports it in the form of BYDAY=MO,BYSETPOS=5
, which python-dateutil parses as BYWEEKDAY=+5MO
Given that we're already wildly off-spec I think right now we should just be concerned with what kind of expressions our UIs are capable of generating. Is it possible to get the recurrence scheduler for snoozes or maintenance windows to output "5th Monday of the month"? If not I'd say let's keep it invalid for now. I'm working to open source the RRule library as its own NPM package independent of Kibana, and we can make spec compliance and a clean break from python-dateutil a part of that effort. For now let's just make sure it's capable of supporting what we expect a Kibana user to create from the UI.
...integration/security_and_spaces/group3/tests/maintenance_window/create_maintenance_window.ts
Outdated
Show resolved
Hide resolved
...integration/security_and_spaces/group3/tests/maintenance_window/create_maintenance_window.ts
Outdated
Show resolved
Hide resolved
Starting backport for target branches: 8.16, 8.17, 8.x |
💚 Build Succeeded
Metrics [docs]
History
cc @adcoelho |
…lastic#207084) Closes elastic#198774 ## Summary - There was a bug when submitting `rrule` with a `byweekday` I fixed that validation to use a more inclusive regex. `byweekday` can be the expected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number corresponds to the week in a month. - The model version for the maintenance window was incorrect so when saving the SO the validation was failing. I fixed that and now we are allowed to save `number[]` as expected. - I removed some duplicated code and we now use the `rrule` schema from the `common` folder (cherry picked from commit 0df78e6) # Conflicts: # x-pack/platform/plugins/shared/alerting/common/routes/r_rule/validation/validate_recurrence_by_weekday/latest.ts # x-pack/platform/plugins/shared/alerting/server/application/r_rule/validation/validate_start_date.ts # x-pack/plugins/alerting/server/application/r_rule/schemas/r_rule_request_schema.ts # x-pack/plugins/alerting/server/application/r_rule/types/r_rule_request.ts # x-pack/plugins/alerting/server/application/r_rule/validation/index.ts # x-pack/plugins/alerting/server/application/r_rule/validation/validate_end_date.ts # x-pack/plugins/alerting/server/application/r_rule/validation/validate_recurrence_by.ts # x-pack/plugins/alerting/server/application/r_rule/validation/validate_start_date.ts
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…indow (#207084) (#208181) # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)](#207084) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Antonio","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-24T11:40:25Z","message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major"],"title":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window","number":207084,"url":"https://github.com/elastic/kibana/pull/207084","mergeCommit":{"message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207084","number":207084,"mergeCommit":{"message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0"}}]}] BACKPORT-->
…lastic#207084) Closes elastic#198774 - There was a bug when submitting `rrule` with a `byweekday` I fixed that validation to use a more inclusive regex. `byweekday` can be the expected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number corresponds to the week in a month. - The model version for the maintenance window was incorrect so when saving the SO the validation was failing. I fixed that and now we are allowed to save `number[]` as expected. - I removed some duplicated code and we now use the `rrule` schema from the `common` folder (cherry picked from commit 0df78e6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…lastic#207084) Closes elastic#198774 - There was a bug when submitting `rrule` with a `byweekday` I fixed that validation to use a more inclusive regex. `byweekday` can be the expected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number corresponds to the week in a month. - The model version for the maintenance window was incorrect so when saving the SO the validation was failing. I fixed that and now we are allowed to save `number[]` as expected. - I removed some duplicated code and we now use the `rrule` schema from the `common` folder (cherry picked from commit 0df78e6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…lastic#207084) Closes elastic#198774 - There was a bug when submitting `rrule` with a `byweekday` I fixed that validation to use a more inclusive regex. `byweekday` can be the expected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number corresponds to the week in a month. - The model version for the maintenance window was incorrect so when saving the SO the validation was failing. I fixed that and now we are allowed to save `number[]` as expected. - I removed some duplicated code and we now use the `rrule` schema from the `common` folder (cherry picked from commit 0df78e6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…Window (#207084) (#208313) # Backport This will backport the following commits from `main` to `8.16`: - [[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)](#207084) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Antonio","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-24T11:40:25Z","message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.18.0"],"title":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window","number":207084,"url":"https://github.com/elastic/kibana/pull/207084","mergeCommit":{"message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207084","number":207084,"mergeCommit":{"message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/208181","number":208181,"state":"MERGED","mergeCommit":{"sha":"8759f0286675744937e4ed8f5ad4880e35f6547e","message":"[8.x] [ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084) (#208181)\n\n# Backport\r\n\r\nThis will backport the following commits from `main` to `8.x`:\r\n- [[ResponseOps][MW] Fix bug when creating repeating Maintenance Window\r\n(#207084)](https://github.com/elastic/kibana/pull/207084)\r\n\r\n<!--- Backport version: 9.6.4 -->\r\n\r\n### Questions ?\r\nPlease refer to the [Backport tool\r\ndocumentation](https://github.com/sorenlouv/backport)\r\n\r\n<!--BACKPORT\r\n[{\"author\":{\"name\":\"Antonio\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2025-01-24T11:40:25Z\",\"message\":\"[ResponseOps][MW]\r\nFix bug when creating repeating Maintenance Window (#207084)\\n\\nCloses\r\n#198774\\r\\n\\r\\n## Summary\\r\\n\\r\\n- There was a bug when submitting\r\n`rrule` with a `byweekday` I fixed\\r\\nthat validation to use a more\r\ninclusive regex. `byweekday` can be the\\r\\nexpected `MO`, `TU`, etc but\r\nalso `-1FR` or `+3SA` where the number\\r\\ncorresponds to the week in a\r\nmonth.\\r\\n- The model version for the maintenance window was incorrect\r\nso when\\r\\nsaving the SO the validation was failing. I fixed that and\r\nnow we are\\r\\nallowed to save `number[]` as expected.\\r\\n- I removed\r\nsome duplicated code and we now use the `rrule` schema from\\r\\nthe\r\n`common`\r\nfolder\",\"sha\":\"0df78e629b429f6007f559aca339b4323b71e4c0\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.18.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Feature:Alerting\",\"release_note:skip\",\"Team:ResponseOps\",\"v9.0.0\",\"backport:prev-major\"],\"title\":\"[ResponseOps][MW]\r\nFix bug when creating repeating Maintenance\r\nWindow\",\"number\":207084,\"url\":\"https://github.com/elastic/kibana/pull/207084\",\"mergeCommit\":{\"message\":\"[ResponseOps][MW]\r\nFix bug when creating repeating Maintenance Window (#207084)\\n\\nCloses\r\n#198774\\r\\n\\r\\n## Summary\\r\\n\\r\\n- There was a bug when submitting\r\n`rrule` with a `byweekday` I fixed\\r\\nthat validation to use a more\r\ninclusive regex. `byweekday` can be the\\r\\nexpected `MO`, `TU`, etc but\r\nalso `-1FR` or `+3SA` where the number\\r\\ncorresponds to the week in a\r\nmonth.\\r\\n- The model version for the maintenance window was incorrect\r\nso when\\r\\nsaving the SO the validation was failing. I fixed that and\r\nnow we are\\r\\nallowed to save `number[]` as expected.\\r\\n- I removed\r\nsome duplicated code and we now use the `rrule` schema from\\r\\nthe\r\n`common`\r\nfolder\",\"sha\":\"0df78e629b429f6007f559aca339b4323b71e4c0\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/207084\",\"number\":207084,\"mergeCommit\":{\"message\":\"[ResponseOps][MW]\r\nFix bug when creating repeating Maintenance Window (#207084)\\n\\nCloses\r\n#198774\\r\\n\\r\\n## Summary\\r\\n\\r\\n- There was a bug when submitting\r\n`rrule` with a `byweekday` I fixed\\r\\nthat validation to use a more\r\ninclusive regex. `byweekday` can be the\\r\\nexpected `MO`, `TU`, etc but\r\nalso `-1FR` or `+3SA` where the number\\r\\ncorresponds to the week in a\r\nmonth.\\r\\n- The model version for the maintenance window was incorrect\r\nso when\\r\\nsaving the SO the validation was failing. I fixed that and\r\nnow we are\\r\\nallowed to save `number[]` as expected.\\r\\n- I removed\r\nsome duplicated code and we now use the `rrule` schema from\\r\\nthe\r\n`common` folder\",\"sha\":\"0df78e629b429f6007f559aca339b4323b71e4c0\"}}]}]\r\nBACKPORT-->"}},{"url":"https://github.com/elastic/kibana/pull/208312","number":208312,"branch":"8.17","state":"OPEN"}]}] BACKPORT-->
…Window (#207084) (#208312) # Backport This will backport the following commits from `main` to `8.17`: - [[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)](#207084) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Antonio","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-24T11:40:25Z","message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.18.0"],"title":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window","number":207084,"url":"https://github.com/elastic/kibana/pull/207084","mergeCommit":{"message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207084","number":207084,"mergeCommit":{"message":"[ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084)\n\nCloses #198774\r\n\r\n## Summary\r\n\r\n- There was a bug when submitting `rrule` with a `byweekday` I fixed\r\nthat validation to use a more inclusive regex. `byweekday` can be the\r\nexpected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number\r\ncorresponds to the week in a month.\r\n- The model version for the maintenance window was incorrect so when\r\nsaving the SO the validation was failing. I fixed that and now we are\r\nallowed to save `number[]` as expected.\r\n- I removed some duplicated code and we now use the `rrule` schema from\r\nthe `common` folder","sha":"0df78e629b429f6007f559aca339b4323b71e4c0"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/208181","number":208181,"state":"MERGED","mergeCommit":{"sha":"8759f0286675744937e4ed8f5ad4880e35f6547e","message":"[8.x] [ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084) (#208181)\n\n# Backport\r\n\r\nThis will backport the following commits from `main` to `8.x`:\r\n- [[ResponseOps][MW] Fix bug when creating repeating Maintenance Window\r\n(#207084)](https://github.com/elastic/kibana/pull/207084)\r\n\r\n<!--- Backport version: 9.6.4 -->\r\n\r\n### Questions ?\r\nPlease refer to the [Backport tool\r\ndocumentation](https://github.com/sorenlouv/backport)\r\n\r\n<!--BACKPORT\r\n[{\"author\":{\"name\":\"Antonio\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2025-01-24T11:40:25Z\",\"message\":\"[ResponseOps][MW]\r\nFix bug when creating repeating Maintenance Window (#207084)\\n\\nCloses\r\n#198774\\r\\n\\r\\n## Summary\\r\\n\\r\\n- There was a bug when submitting\r\n`rrule` with a `byweekday` I fixed\\r\\nthat validation to use a more\r\ninclusive regex. `byweekday` can be the\\r\\nexpected `MO`, `TU`, etc but\r\nalso `-1FR` or `+3SA` where the number\\r\\ncorresponds to the week in a\r\nmonth.\\r\\n- The model version for the maintenance window was incorrect\r\nso when\\r\\nsaving the SO the validation was failing. I fixed that and\r\nnow we are\\r\\nallowed to save `number[]` as expected.\\r\\n- I removed\r\nsome duplicated code and we now use the `rrule` schema from\\r\\nthe\r\n`common`\r\nfolder\",\"sha\":\"0df78e629b429f6007f559aca339b4323b71e4c0\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.18.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Feature:Alerting\",\"release_note:skip\",\"Team:ResponseOps\",\"v9.0.0\",\"backport:prev-major\"],\"title\":\"[ResponseOps][MW]\r\nFix bug when creating repeating Maintenance\r\nWindow\",\"number\":207084,\"url\":\"https://github.com/elastic/kibana/pull/207084\",\"mergeCommit\":{\"message\":\"[ResponseOps][MW]\r\nFix bug when creating repeating Maintenance Window (#207084)\\n\\nCloses\r\n#198774\\r\\n\\r\\n## Summary\\r\\n\\r\\n- There was a bug when submitting\r\n`rrule` with a `byweekday` I fixed\\r\\nthat validation to use a more\r\ninclusive regex. `byweekday` can be the\\r\\nexpected `MO`, `TU`, etc but\r\nalso `-1FR` or `+3SA` where the number\\r\\ncorresponds to the week in a\r\nmonth.\\r\\n- The model version for the maintenance window was incorrect\r\nso when\\r\\nsaving the SO the validation was failing. I fixed that and\r\nnow we are\\r\\nallowed to save `number[]` as expected.\\r\\n- I removed\r\nsome duplicated code and we now use the `rrule` schema from\\r\\nthe\r\n`common`\r\nfolder\",\"sha\":\"0df78e629b429f6007f559aca339b4323b71e4c0\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/207084\",\"number\":207084,\"mergeCommit\":{\"message\":\"[ResponseOps][MW]\r\nFix bug when creating repeating Maintenance Window (#207084)\\n\\nCloses\r\n#198774\\r\\n\\r\\n## Summary\\r\\n\\r\\n- There was a bug when submitting\r\n`rrule` with a `byweekday` I fixed\\r\\nthat validation to use a more\r\ninclusive regex. `byweekday` can be the\\r\\nexpected `MO`, `TU`, etc but\r\nalso `-1FR` or `+3SA` where the number\\r\\ncorresponds to the week in a\r\nmonth.\\r\\n- The model version for the maintenance window was incorrect\r\nso when\\r\\nsaving the SO the validation was failing. I fixed that and\r\nnow we are\\r\\nallowed to save `number[]` as expected.\\r\\n- I removed\r\nsome duplicated code and we now use the `rrule` schema from\\r\\nthe\r\n`common` folder\",\"sha\":\"0df78e629b429f6007f559aca339b4323b71e4c0\"}}]}]\r\nBACKPORT-->"}}]}] BACKPORT-->
…lastic#207084) Closes elastic#198774 ## Summary - There was a bug when submitting `rrule` with a `byweekday` I fixed that validation to use a more inclusive regex. `byweekday` can be the expected `MO`, `TU`, etc but also `-1FR` or `+3SA` where the number corresponds to the week in a month. - The model version for the maintenance window was incorrect so when saving the SO the validation was failing. I fixed that and now we are allowed to save `number[]` as expected. - I removed some duplicated code and we now use the `rrule` schema from the `common` folder
Closes #198774
Summary
rrule
with abyweekday
I fixed that validation to use a more inclusive regex.byweekday
can be the expectedMO
,TU
, etc but also-1FR
or+3SA
where the number corresponds to the week in a month.number[]
as expected.rrule
schema from thecommon
folder