Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.12] [Security Solution] "Data view" selector is shown in…
… "Edit filter" view on the Rule Editing page (#174026) (#174922) (#175433) # Backport This will backport the following commits from `main` to `8.12`: - [[Security Solution] "Data view" selector is shown in "Edit filter" view on the Rule Editing page (#174026) (#174922)](#174922) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ievgen Sorokopud","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-24T13:34:54Z","message":"[Security Solution] \"Data view\" selector is shown in \"Edit filter\" view on the Rule Editing page (#174026) (#174922)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/kibana/issues/174026\r\n\r\nThese changes fix the issue with filter editing on the rule's editing\r\npage when using index patterns instead of data view.\r\n\r\n**Steps to reproduce**:\r\n1. Create a custom query rule and add a filter\r\n2. Save the rule\r\n3. Edit the rule\r\n4. Edit the filter\r\n\r\n**Current behaviour**:\r\nRight now when user tries to edit the filter the data view picking UI\r\nappears even though index patterns were not modified.\r\n\r\n<img width=\"1261\" alt=\"Screenshot 2024-01-16 at 15 14 23\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/b2d28b79-a7d8-482c-a2be-fa8e20cb9e25\">\r\n\r\n**Expected behaviour**:\r\nData view picking UI should not be present and previously set field and\r\nvalue options should be shown in the filter editing dialog.\r\n\r\n<img width=\"1252\" alt=\"Screenshot 2024-01-16 at 15 16 07\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/bb99dd9f-aa6a-4003-b8c4-ccda344c4c5c\">\r\n\r\n**Cause**:\r\nThe behaviour for the filter editing on rule’s editing page changed in\r\n`8.11` with these changes https://github.com/elastic/kibana/pull/166318.\r\nWe convert `DataViewBase` object without ID set to a `DataView` object\r\nwith auto-generated ID. This happens each time we try to edit the rule\r\nand leads to a different ID which is saved in `filter.meta.index`.\r\nUnified search internally checks those IDs to verify whether the filter\r\nbelongs to provided data view.\r\n\r\n**Solution**:\r\nTo solve this issue, we set the data view id explicitly on creating an\r\nin-memory data view that represents index patterns and update\r\n`filter.meta.index` to use the same ID.\r\n\r\n~~**Known issue**:\r\nThis does not resolve the issue for existing filters. In this case, user\r\nwill need to update their filters manually.~~ (This was fixed by\r\nupdating `filter.meta.index` field on rule editing)\r\n\r\n**Flaky test runner**\r\n[ESS 50\r\ntimes](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4927)\r\n[Serverless 50\r\ntimes](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4935)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f0f6274b9563cc453a11a937fe66f3bfbe8311bf","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team: SecuritySolution","backport:prev-minor","Team:Detection Engine","v8.13.0"],"title":"[Security Solution] \"Data view\" selector is shown in \"Edit filter\" view on the Rule Editing page (#174026)","number":174922,"url":"https://github.com/elastic/kibana/pull/174922","mergeCommit":{"message":"[Security Solution] \"Data view\" selector is shown in \"Edit filter\" view on the Rule Editing page (#174026) (#174922)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/kibana/issues/174026\r\n\r\nThese changes fix the issue with filter editing on the rule's editing\r\npage when using index patterns instead of data view.\r\n\r\n**Steps to reproduce**:\r\n1. Create a custom query rule and add a filter\r\n2. Save the rule\r\n3. Edit the rule\r\n4. Edit the filter\r\n\r\n**Current behaviour**:\r\nRight now when user tries to edit the filter the data view picking UI\r\nappears even though index patterns were not modified.\r\n\r\n<img width=\"1261\" alt=\"Screenshot 2024-01-16 at 15 14 23\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/b2d28b79-a7d8-482c-a2be-fa8e20cb9e25\">\r\n\r\n**Expected behaviour**:\r\nData view picking UI should not be present and previously set field and\r\nvalue options should be shown in the filter editing dialog.\r\n\r\n<img width=\"1252\" alt=\"Screenshot 2024-01-16 at 15 16 07\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/bb99dd9f-aa6a-4003-b8c4-ccda344c4c5c\">\r\n\r\n**Cause**:\r\nThe behaviour for the filter editing on rule’s editing page changed in\r\n`8.11` with these changes https://github.com/elastic/kibana/pull/166318.\r\nWe convert `DataViewBase` object without ID set to a `DataView` object\r\nwith auto-generated ID. This happens each time we try to edit the rule\r\nand leads to a different ID which is saved in `filter.meta.index`.\r\nUnified search internally checks those IDs to verify whether the filter\r\nbelongs to provided data view.\r\n\r\n**Solution**:\r\nTo solve this issue, we set the data view id explicitly on creating an\r\nin-memory data view that represents index patterns and update\r\n`filter.meta.index` to use the same ID.\r\n\r\n~~**Known issue**:\r\nThis does not resolve the issue for existing filters. In this case, user\r\nwill need to update their filters manually.~~ (This was fixed by\r\nupdating `filter.meta.index` field on rule editing)\r\n\r\n**Flaky test runner**\r\n[ESS 50\r\ntimes](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4927)\r\n[Serverless 50\r\ntimes](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4935)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f0f6274b9563cc453a11a937fe66f3bfbe8311bf"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/174922","number":174922,"mergeCommit":{"message":"[Security Solution] \"Data view\" selector is shown in \"Edit filter\" view on the Rule Editing page (#174026) (#174922)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/kibana/issues/174026\r\n\r\nThese changes fix the issue with filter editing on the rule's editing\r\npage when using index patterns instead of data view.\r\n\r\n**Steps to reproduce**:\r\n1. Create a custom query rule and add a filter\r\n2. Save the rule\r\n3. Edit the rule\r\n4. Edit the filter\r\n\r\n**Current behaviour**:\r\nRight now when user tries to edit the filter the data view picking UI\r\nappears even though index patterns were not modified.\r\n\r\n<img width=\"1261\" alt=\"Screenshot 2024-01-16 at 15 14 23\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/b2d28b79-a7d8-482c-a2be-fa8e20cb9e25\">\r\n\r\n**Expected behaviour**:\r\nData view picking UI should not be present and previously set field and\r\nvalue options should be shown in the filter editing dialog.\r\n\r\n<img width=\"1252\" alt=\"Screenshot 2024-01-16 at 15 16 07\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/bb99dd9f-aa6a-4003-b8c4-ccda344c4c5c\">\r\n\r\n**Cause**:\r\nThe behaviour for the filter editing on rule’s editing page changed in\r\n`8.11` with these changes https://github.com/elastic/kibana/pull/166318.\r\nWe convert `DataViewBase` object without ID set to a `DataView` object\r\nwith auto-generated ID. This happens each time we try to edit the rule\r\nand leads to a different ID which is saved in `filter.meta.index`.\r\nUnified search internally checks those IDs to verify whether the filter\r\nbelongs to provided data view.\r\n\r\n**Solution**:\r\nTo solve this issue, we set the data view id explicitly on creating an\r\nin-memory data view that represents index patterns and update\r\n`filter.meta.index` to use the same ID.\r\n\r\n~~**Known issue**:\r\nThis does not resolve the issue for existing filters. In this case, user\r\nwill need to update their filters manually.~~ (This was fixed by\r\nupdating `filter.meta.index` field on rule editing)\r\n\r\n**Flaky test runner**\r\n[ESS 50\r\ntimes](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4927)\r\n[Serverless 50\r\ntimes](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4935)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f0f6274b9563cc453a11a937fe66f3bfbe8311bf"}}]}] BACKPORT--> --------- Co-authored-by: Ievgen Sorokopud <[email protected]>
- Loading branch information