[RAM][8.8] Fix get active maintenance window query#157112
Merged
JiaweiWu merged 4 commits intoelastic:mainfrom May 9, 2023
Merged
[RAM][8.8] Fix get active maintenance window query#157112JiaweiWu merged 4 commits intoelastic:mainfrom
JiaweiWu merged 4 commits intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/response-ops (Team:ResponseOps) |
…-ref HEAD~1..HEAD --fix'
XavierM
approved these changes
May 9, 2023
….com/JiaweiWu/kibana into fix-mw-get-active-maintenance-window
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
May 9, 2023
## Summary
Fix the active maintenance window query, originally the KQL query got
converted to something like:
```
query: {
bool: {
filter: [
{
range: {
'maintenance-window.attributes.events': {
gte: from,
},
},
},
{
range: {
'maintenance-window.attributes.events': {
lte: to,
},
},
},
],
},
},
```
When in reality we wanted a query like:
```
query: {
bool: {
filter:
range: {
'maintenance-window.attributes.events': {
gte: from,
lte: to,
},
},
},
},
},
```
Which return some upcoming maintenance windows that we did not want.
### 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
(cherry picked from commit 6d4f695)
Contributor
💚 All backports created successfully
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 9, 2023
…157119) # Backport This will backport the following commits from `main` to `8.8`: - [[RAM][8.8] Fix get active maintenance window query (#157112)](#157112) <!--- Backport version: 8.9.7 --> ### 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":"2023-05-09T02:27:59Z","message":"[RAM][8.8] Fix get active maintenance window query (#157112)\n\n## Summary\r\nFix the active maintenance window query, originally the KQL query got\r\nconverted to something like:\r\n\r\n```\r\n query: {\r\n bool: {\r\n filter: [\r\n {\r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n gte: from,\r\n },\r\n },\r\n },\r\n {\r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n lte: to,\r\n },\r\n },\r\n },\r\n ],\r\n },\r\n},\r\n```\r\nWhen in reality we wanted a query like:\r\n\r\n```\r\nquery: {\r\n bool: {\r\n filter: \r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n gte: from,\r\n lte: to,\r\n },\r\n },\r\n },\r\n },\r\n},\r\n```\r\nWhich return some upcoming maintenance windows that we did not want.\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","sha":"6d4f695b759b8fe30ac7314951c39dce6f27e376","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","backport","release_note:skip","Team:ResponseOps","Feature:Alerting/RulesManagement","v8.8.0","v8.9.0"],"number":157112,"url":"https://github.com/elastic/kibana/pull/157112","mergeCommit":{"message":"[RAM][8.8] Fix get active maintenance window query (#157112)\n\n## Summary\r\nFix the active maintenance window query, originally the KQL query got\r\nconverted to something like:\r\n\r\n```\r\n query: {\r\n bool: {\r\n filter: [\r\n {\r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n gte: from,\r\n },\r\n },\r\n },\r\n {\r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n lte: to,\r\n },\r\n },\r\n },\r\n ],\r\n },\r\n},\r\n```\r\nWhen in reality we wanted a query like:\r\n\r\n```\r\nquery: {\r\n bool: {\r\n filter: \r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n gte: from,\r\n lte: to,\r\n },\r\n },\r\n },\r\n },\r\n},\r\n```\r\nWhich return some upcoming maintenance windows that we did not want.\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","sha":"6d4f695b759b8fe30ac7314951c39dce6f27e376"}},"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/157112","number":157112,"mergeCommit":{"message":"[RAM][8.8] Fix get active maintenance window query (#157112)\n\n## Summary\r\nFix the active maintenance window query, originally the KQL query got\r\nconverted to something like:\r\n\r\n```\r\n query: {\r\n bool: {\r\n filter: [\r\n {\r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n gte: from,\r\n },\r\n },\r\n },\r\n {\r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n lte: to,\r\n },\r\n },\r\n },\r\n ],\r\n },\r\n},\r\n```\r\nWhen in reality we wanted a query like:\r\n\r\n```\r\nquery: {\r\n bool: {\r\n filter: \r\n range: {\r\n 'maintenance-window.attributes.events': {\r\n gte: from,\r\n lte: to,\r\n },\r\n },\r\n },\r\n },\r\n},\r\n```\r\nWhich return some upcoming maintenance windows that we did not want.\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","sha":"6d4f695b759b8fe30ac7314951c39dce6f27e376"}}]}] BACKPORT--> Co-authored-by: Jiawei Wu <74562234+JiaweiWu@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the active maintenance window query, originally the KQL query got converted to something like:
When in reality we wanted a query like:
Which return some upcoming maintenance windows that we did not want.
Checklist