Skip to content

[9.3] [ResponseOps][Maintenance Window] Maintenance Window does not apply when using wildcard via Query DSL (#256622)#259303

Merged
georgianaonoleata1904 merged 12 commits intoelastic:9.3from
georgianaonoleata1904:backport/9.3/pr-256622
Apr 6, 2026
Merged

[9.3] [ResponseOps][Maintenance Window] Maintenance Window does not apply when using wildcard via Query DSL (#256622)#259303
georgianaonoleata1904 merged 12 commits intoelastic:9.3from
georgianaonoleata1904:backport/9.3/pr-256622

Conversation

@georgianaonoleata1904
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

…hen using wildcard via Query DSL (elastic#256622)

Closes elastic#252656
Closes elastic#253857

## Summary

Fixed MW alert filtering when using wildcards.
- `buildEsQuery()` was called with `undefined` for the index pattern
param so the KQL compiler couldn't determine field types
- fix: pass a `DataViewBase` with `esTypes` from `alertFieldMap`,
enabling correct wildcard handling for keyword fields

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit f26f09a)

# Conflicts:
#	x-pack/platform/plugins/shared/maintenance_windows/moon.yml
#	x-pack/platform/plugins/shared/maintenance_windows/server/application/methods/create/create_maintenance_window.test.ts
#	x-pack/platform/plugins/shared/maintenance_windows/server/application/methods/create/create_maintenance_window.ts
#	x-pack/platform/plugins/shared/maintenance_windows/server/application/methods/update/update_maintenance_window.test.ts
#	x-pack/platform/plugins/shared/maintenance_windows/server/application/methods/update/update_maintenance_window.ts
#	x-pack/platform/plugins/shared/maintenance_windows/tsconfig.json
kql: `kibana.alert.rule.name: ${kqlPattern}`,
filters: [],
},
scopedQuery: {
Copy link
Copy Markdown
Contributor

@adcoelho adcoelho Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here? This field had a different name?

Are these tests that were added by you in the original PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, something like this, those tests were using the HTTP body shape (schedule / scope). This function only takes the internal shape: scopedQuery (kql + filters)

@georgianaonoleata1904
Copy link
Copy Markdown
Contributor Author

georgianaonoleata1904 commented Mar 27, 2026

Added fix also for: #259514 to be backported together

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 3, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #5 / Trusted devices form Conditions should show performance warning when operator is matches and value contains "**"
  • [job] [logs] Jest Tests #5 / Trusted devices form Conditions should show performance warning when operator is matches and value contains "**"

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
unifiedSearch 395.2KB 395.4KB +220.0B
Unknown metric groups

References to deprecated APIs

id before after diff
unifiedSearch 11 13 +2

History

@georgianaonoleata1904 georgianaonoleata1904 merged commit 4989377 into elastic:9.3 Apr 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants