-
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
[Inventory][ECO] Fix asKqlFilter #200984
[Inventory][ECO] Fix asKqlFilter #200984
Conversation
/ci |
@@ -95,7 +95,7 @@ export class EntityClient { | |||
const identityFieldsValue = this.getIdentityFieldsValue(entityInstance); | |||
|
|||
const nodes: KueryNode[] = Object.entries(identityFieldsValue).map(([identityField, value]) => { | |||
return nodeTypes.function.buildNode('is', identityField, value); | |||
return nodeTypes.function.buildNode('is', identityField, `"${value}"`); |
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.
To reproduce the error, just replace "${value}"
with value
and run the entity_client unit tests
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
Pinging @elastic/obs-entities (Team:obs-entities) |
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.
Thanks for fixing that 🚀
Starting backport for target branches: 8.15, 8.16, 8.17, 8.x https://github.com/elastic/kibana/actions/runs/11952835946 |
fixes [elastic#200981](elastic#200981) ## Summary This PR fixes a problem with the asKqlFilter throwing an error when building filters with string containing special characters. (cherry picked from commit 8f8a671)
fixes [elastic#200981](elastic#200981) ## Summary This PR fixes a problem with the asKqlFilter throwing an error when building filters with string containing special characters. (cherry picked from commit 8f8a671)
💔 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 |
# Backport This will backport the following commits from `main` to `8.x`: - [[Inventory][ECO] Fix asKqlFilter (#200984)](#200984) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Carlos Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-21T12:04:53Z","message":"[Inventory][ECO] Fix asKqlFilter (#200984)\n\nfixes [#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n## Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an error when\r\nbuilding filters with string containing special characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major","Team:obs-ux-infra_services","Team:obs-entities"],"title":"[Inventory][ECO] Fix asKqlFilter","number":200984,"url":"https://github.com/elastic/kibana/pull/200984","mergeCommit":{"message":"[Inventory][ECO] Fix asKqlFilter (#200984)\n\nfixes [#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n## Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an error when\r\nbuilding filters with string containing special characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04"}},"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/200984","number":200984,"mergeCommit":{"message":"[Inventory][ECO] Fix asKqlFilter (#200984)\n\nfixes [#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n## Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an error when\r\nbuilding filters with string containing special characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04"}}]}] BACKPORT--> Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Closes #201189 ## Summary After this fix was added in #200984 the test started failing as it was verifying the previous kuery value - it was missing the `" "` so after this bug was fixed the test should be updated as well (basically changing `container.id:foo` with `container.id:"foo"`) and this PR updates the test. I checked locally and the test is passing now.
Closes elastic#201189 ## Summary After this fix was added in elastic#200984 the test started failing as it was verifying the previous kuery value - it was missing the `" "` so after this bug was fixed the test should be updated as well (basically changing `container.id:foo` with `container.id:"foo"`) and this PR updates the test. I checked locally and the test is passing now. (cherry picked from commit 74cf5d4)
# Backport This will backport the following commits from `main` to `8.x`: - [[Inventory] Fix the link to discover test (#201197)](#201197) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"jennypavlova","email":"dzheni.pavlova@elastic.co"},"sourceCommit":{"committedDate":"2024-11-21T17:14:43Z","message":"[Inventory] Fix the link to discover test (#201197)\n\nCloses #201189\r\n\r\n## Summary\r\n\r\nAfter this fix was added in\r\nhttps://github.com//pull/200984 the test started failing\r\nas it was verifying the previous kuery value - it was missing the `\" \"`\r\nso after this bug was fixed the test should be updated as well\r\n(basically changing `container.id:foo` with `container.id:\"foo\"`) and\r\nthis PR updates the test.\r\n\r\nI checked locally and the test is passing now.","sha":"74cf5d45784b9f633decae428c61ff96281dcc4b","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services"],"title":"[Inventory] Fix the link to discover test","number":201197,"url":"https://github.com/elastic/kibana/pull/201197","mergeCommit":{"message":"[Inventory] Fix the link to discover test (#201197)\n\nCloses #201189\r\n\r\n## Summary\r\n\r\nAfter this fix was added in\r\nhttps://github.com//pull/200984 the test started failing\r\nas it was verifying the previous kuery value - it was missing the `\" \"`\r\nso after this bug was fixed the test should be updated as well\r\n(basically changing `container.id:foo` with `container.id:\"foo\"`) and\r\nthis PR updates the test.\r\n\r\nI checked locally and the test is passing now.","sha":"74cf5d45784b9f633decae428c61ff96281dcc4b"}},"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/201197","number":201197,"mergeCommit":{"message":"[Inventory] Fix the link to discover test (#201197)\n\nCloses #201189\r\n\r\n## Summary\r\n\r\nAfter this fix was added in\r\nhttps://github.com//pull/200984 the test started failing\r\nas it was verifying the previous kuery value - it was missing the `\" \"`\r\nso after this bug was fixed the test should be updated as well\r\n(basically changing `container.id:foo` with `container.id:\"foo\"`) and\r\nthis PR updates the test.\r\n\r\nI checked locally and the test is passing now.","sha":"74cf5d45784b9f633decae428c61ff96281dcc4b"}}]}] BACKPORT--> Co-authored-by: jennypavlova <dzheni.pavlova@elastic.co>
# Backport This will backport the following commits from `main` to `8.17`: - [[Inventory][ECO] Fix asKqlFilter (#200984)](#200984) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Carlos Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-21T12:04:53Z","message":"[Inventory][ECO] Fix asKqlFilter (#200984)\n\nfixes [#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n## Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an error when\r\nbuilding filters with string containing special characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major","Team:obs-ux-infra_services","Team:obs-entities"],"title":"[Inventory][ECO] Fix asKqlFilter","number":200984,"url":"https://github.com/elastic/kibana/pull/200984","mergeCommit":{"message":"[Inventory][ECO] Fix asKqlFilter (#200984)\n\nfixes [#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n## Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an error when\r\nbuilding filters with string containing special characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04"}},"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/200984","number":200984,"mergeCommit":{"message":"[Inventory][ECO] Fix asKqlFilter (#200984)\n\nfixes [#200981](https://github.com/elastic/kibana/issues/200981)\r\n\r\n## Summary\r\n\r\nThis PR fixes a problem with the asKqlFilter throwing an error when\r\nbuilding filters with string containing special characters.","sha":"8f8a671567f429814f049965db5dbf2a92582c04"}}]}] BACKPORT--> Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Closes elastic#201189 ## Summary After this fix was added in elastic#200984 the test started failing as it was verifying the previous kuery value - it was missing the `" "` so after this bug was fixed the test should be updated as well (basically changing `container.id:foo` with `container.id:"foo"`) and this PR updates the test. I checked locally and the test is passing now. (cherry picked from commit 74cf5d4)
# Backport This will backport the following commits from `main` to `8.17`: - [[Inventory] Fix the link to discover test (#201197)](#201197) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"jennypavlova","email":"dzheni.pavlova@elastic.co"},"sourceCommit":{"committedDate":"2024-11-21T17:14:43Z","message":"[Inventory] Fix the link to discover test (#201197)\n\nCloses #201189\r\n\r\n## Summary\r\n\r\nAfter this fix was added in\r\nhttps://github.com//pull/200984 the test started failing\r\nas it was verifying the previous kuery value - it was missing the `\" \"`\r\nso after this bug was fixed the test should be updated as well\r\n(basically changing `container.id:foo` with `container.id:\"foo\"`) and\r\nthis PR updates the test.\r\n\r\nI checked locally and the test is passing now.","sha":"74cf5d45784b9f633decae428c61ff96281dcc4b","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.18.0"],"number":201197,"url":"https://github.com/elastic/kibana/pull/201197","mergeCommit":{"message":"[Inventory] Fix the link to discover test (#201197)\n\nCloses #201189\r\n\r\n## Summary\r\n\r\nAfter this fix was added in\r\nhttps://github.com//pull/200984 the test started failing\r\nas it was verifying the previous kuery value - it was missing the `\" \"`\r\nso after this bug was fixed the test should be updated as well\r\n(basically changing `container.id:foo` with `container.id:\"foo\"`) and\r\nthis PR updates the test.\r\n\r\nI checked locally and the test is passing now.","sha":"74cf5d45784b9f633decae428c61ff96281dcc4b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201197","number":201197,"mergeCommit":{"message":"[Inventory] Fix the link to discover test (#201197)\n\nCloses #201189\r\n\r\n## Summary\r\n\r\nAfter this fix was added in\r\nhttps://github.com//pull/200984 the test started failing\r\nas it was verifying the previous kuery value - it was missing the `\" \"`\r\nso after this bug was fixed the test should be updated as well\r\n(basically changing `container.id:foo` with `container.id:\"foo\"`) and\r\nthis PR updates the test.\r\n\r\nI checked locally and the test is passing now.","sha":"74cf5d45784b9f633decae428c61ff96281dcc4b"}},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/201252","number":201252,"state":"MERGED","mergeCommit":{"sha":"b342de58951e78ad8921704499231a9d78100ca9","message":"[8.x] [Inventory] Fix the link to discover test (#201197) (#201252)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.x`:\n- [[Inventory] Fix the link to discover test\n(#201197)](https://github.com/elastic/kibana/pull/201197)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT\n[{\"author\":{\"name\":\"jennypavlova\",\"email\":\"dzheni.pavlova@elastic.co\"},\"sourceCommit\":{\"committedDate\":\"2024-11-21T17:14:43Z\",\"message\":\"[Inventory]\nFix the link to discover test (#201197)\\n\\nCloses #201189\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nAfter this fix was added\nin\\r\\nhttps://github.com//pull/200984 the test started\nfailing\\r\\nas it was verifying the previous kuery value - it was missing\nthe `\\\" \\\"`\\r\\nso after this bug was fixed the test should be updated as\nwell\\r\\n(basically changing `container.id:foo` with\n`container.id:\\\"foo\\\"`) and\\r\\nthis PR updates the test.\\r\\n\\r\\nI\nchecked locally and the test is passing\nnow.\",\"sha\":\"74cf5d45784b9f633decae428c61ff96281dcc4b\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.18.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"v9.0.0\",\"backport:prev-minor\",\"ci:project-deploy-observability\",\"Team:obs-ux-infra_services\"],\"title\":\"[Inventory]\nFix the link to discover\ntest\",\"number\":201197,\"url\":\"https://github.com/elastic/kibana/pull/201197\",\"mergeCommit\":{\"message\":\"[Inventory]\nFix the link to discover test (#201197)\\n\\nCloses #201189\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nAfter this fix was added\nin\\r\\nhttps://github.com//pull/200984 the test started\nfailing\\r\\nas it was verifying the previous kuery value - it was missing\nthe `\\\" \\\"`\\r\\nso after this bug was fixed the test should be updated as\nwell\\r\\n(basically changing `container.id:foo` with\n`container.id:\\\"foo\\\"`) and\\r\\nthis PR updates the test.\\r\\n\\r\\nI\nchecked locally and the test is passing\nnow.\",\"sha\":\"74cf5d45784b9f633decae428c61ff96281dcc4b\"}},\"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/201197\",\"number\":201197,\"mergeCommit\":{\"message\":\"[Inventory]\nFix the link to discover test (#201197)\\n\\nCloses #201189\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nAfter this fix was added\nin\\r\\nhttps://github.com//pull/200984 the test started\nfailing\\r\\nas it was verifying the previous kuery value - it was missing\nthe `\\\" \\\"`\\r\\nso after this bug was fixed the test should be updated as\nwell\\r\\n(basically changing `container.id:foo` with\n`container.id:\\\"foo\\\"`) and\\r\\nthis PR updates the test.\\r\\n\\r\\nI\nchecked locally and the test is passing\nnow.\",\"sha\":\"74cf5d45784b9f633decae428c61ff96281dcc4b\"}}]}] BACKPORT-->\n\nCo-authored-by: jennypavlova <dzheni.pavlova@elastic.co>"}}]}] BACKPORT--> Co-authored-by: jennypavlova <dzheni.pavlova@elastic.co>
fixes [elastic#200981](elastic#200981) ## Summary This PR fixes a problem with the asKqlFilter throwing an error when building filters with string containing special characters.
Closes elastic#201189 ## Summary After this fix was added in elastic#200984 the test started failing as it was verifying the previous kuery value - it was missing the `" "` so after this bug was fixed the test should be updated as well (basically changing `container.id:foo` with `container.id:"foo"`) and this PR updates the test. I checked locally and the test is passing now.
fixes [elastic#200981](elastic#200981) ## Summary This PR fixes a problem with the asKqlFilter throwing an error when building filters with string containing special characters.
Closes elastic#201189 ## Summary After this fix was added in elastic#200984 the test started failing as it was verifying the previous kuery value - it was missing the `" "` so after this bug was fixed the test should be updated as well (basically changing `container.id:foo` with `container.id:"foo"`) and this PR updates the test. I checked locally and the test is passing now.
fixes #200981
Summary
This PR fixes a problem with the asKqlFilter throwing an error when building filters with string containing special characters.