Skip to content
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

Fix unhandled alias search errors #128289

Merged
merged 4 commits into from
Mar 24, 2022

Conversation

jportner
Copy link
Contributor

Resolves #128282.

This fixes certain edge cases that could cause the ES kuery builder to throw an unexpected error when a saved object ID contains a : character.

This is a bug fix, but I'm labeling this as release_note:skip because this bug doesn't have any practical impact on users in past versions of Kibana.

@jportner jportner added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.2.0 labels Mar 22, 2022
The data plugin already defined this function, I just moved it to
the @kbn/es-kuery package so other consumers could use it too.
@jportner jportner marked this pull request as ready for review March 23, 2022 13:48
@jportner jportner requested review from a team as code owners March 23, 2022 13:48
Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Changes LGTM

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

Thank you for that

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

LGTM!

@jportner
Copy link
Contributor Author

@elasticmachine merge upstream

@jportner jportner enabled auto-merge (squash) March 24, 2022 17:25
@jportner jportner merged commit b12697d into elastic:main Mar 24, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
canvas 1088 1090 +2
controls 145 147 +2
dashboard 266 268 +2
dashboardEnhanced 88 90 +2
data 535 537 +2
dataViewManagement 137 139 +2
dataVisualizer 345 347 +2
discover 430 432 +2
fleet 573 575 +2
infra 936 938 +2
inputControlVis 101 103 +2
lens 783 785 +2
lists 297 299 +2
maps 777 779 +2
ml 1555 1557 +2
monitoring 497 499 +2
observability 384 386 +2
securitySolution 2986 2988 +2
stackAlerts 111 113 +2
timelines 274 276 +2
transform 298 300 +2
upgradeAssistant 192 194 +2
uptime 731 733 +2
visTypeTimelion 111 113 +2
visTypeVega 228 230 +2
visualizations 216 218 +2
total +52

Async chunks

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

id before after diff
canvas 1.0MB 1.0MB +282.0B
controls 403.4KB 403.6KB +282.0B
dashboard 294.8KB 295.1KB +326.0B
dataViewManagement 123.4KB 123.7KB +283.0B
dataVisualizer 538.7KB 539.0KB +282.0B
discover 380.8KB 381.2KB +326.0B
fleet 678.7KB 679.0KB +278.0B
infra 1002.9KB 1003.1KB +282.0B
inputControlVis 77.3KB 77.6KB +278.0B
lens 1.1MB 1.1MB +282.0B
lists 147.5KB 147.7KB +283.0B
ml 3.3MB 3.3MB +282.0B
monitoring 470.7KB 471.0KB +282.0B
stackAlerts 193.9KB 194.2KB +278.0B
transform 374.7KB 374.9KB +282.0B
upgradeAssistant 178.9KB 179.2KB +278.0B
uptime 753.8KB 754.1KB +282.0B
visTypeTimelion 120.7KB 120.9KB +282.0B
visTypeVega 1.7MB 1.7MB +282.0B
visualizations 164.3KB 164.5KB +278.0B
total +5.6KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dashboardEnhanced 41.3KB 41.6KB +282.0B
data 459.5KB 459.6KB +56.0B
maps 69.0KB 69.3KB +278.0B
observability 90.3KB 90.5KB +278.0B
securitySolution 247.1KB 247.4KB +282.0B
timelines 285.9KB 286.2KB +282.0B
total +1.4KB
Unknown metric groups

API count

id before after diff
@kbn/es-query 211 213 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jportner jportner deleted the issue-128282-fix-alias-search-error branch March 24, 2022 18:55
logeekal added a commit to logeekal/kibana that referenced this pull request Nov 4, 2024
logeekal added a commit that referenced this pull request Dec 3, 2024
… grammer (#198288)

## Summary

As mentioned in
https://github.com/elastic/kibana/security/code-scanning/349, this PR
resolves the escaping issue.

Additionally, it also adds more candiadates for escaping as mentioned in
`kuery` grammar as shown below .


https://github.com/elastic/kibana/blob/d6b4fe9e6ee2e18691b0fa818c4e2c4ed3c413fc/packages/kbn-es-query/grammar/grammar.peggy#L295-L298

## Solution

This PR replicates #128289 in
`7.17` where `escape_kquery` was moved from `data` plugin to `es-query`
package. This should have been backported to `7.17` but was not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saved Object API calls that search for aliases can result in unhandled error
6 participants