-
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
[Security Solution][Fix] Empty Alert Table when upgrading from 8.8.x -> 8.9 #162063
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
@@ -100,7 +112,7 @@ export const migrateAlertTableStateToTriggerActionsState = ( | |||
sort: legacyDataTableState[tableKey].sort.map((sortCandidate) => ({ | |||
[sortCandidate.columnId]: { order: sortCandidate.sortDirection }, | |||
})), | |||
visibleColumns: legacyDataTableState[tableKey].columns.map((c) => c.id), | |||
visibleColumns: legacyDataTableState[tableKey].columns, |
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.
return; | ||
} | ||
|
||
if ('visibleColumns' in alertTableData) { |
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.
Can we have one more early exit here?
const nonCompliant = alertTableData.visibleColumns.some(val => typeof val !== 'string')
if (!nonCompliant) return
... or this if you prefer
if (nonCompliant) {
alertTableData.visibleColumns.map(...)
}
Right now the map will most likely run every time someone loads the table for every version after this
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.
You are right.. made these changes with a little tweak.
const visibleColumns = | ||
alertTableData.visibleColumns as DataTableState['dataTable']['tableById'][string]['columns']; | ||
const v89CompliantFormat = visibleColumns.every((val: unknown) => typeof val === 'string'); | ||
if (v89CompliantFormat) { |
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.
Sweet, this works! 👍🏾
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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 getting this fix in!
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…-> 8.9 (elastic#162063) ## Summary When users upgrade from `8.8.x` -> `8.9` version, users observe empty table as shown below. ![image](https://github.com/elastic/kibana/assets/7485038/20549edb-07b9-4124-a0ac-7515cf0e2796) Below are steps to reproduce this issue and test it: 1. Boot [email protected] 2. Clear Local storage. 3. Go to Security -> Alerts 4. Add Columns `_id` or any other column 5. Upgrade to `8.9` 6. The table will empty as shown in above screenshot. ## Fix This fix saperates out the migraton from 8.7 -> 8.8 and add a new migration for upgrading from 8.8 -> 8.9 `migrateAlertTableStateToTriggerActionsState` migrates table from `v8.7 -> v8.8`, `migrateTriggerActionsVisibleColumnsAlertTable88xTo89` migrates from `v8.8.x` -> `v8.9` Combining both of them may lead to issues when users are migrating from `v8.7` -> `v8.9` or `v8.8` -> `v8.9` (cherry picked from commit 0516cae)
…-> 8.9 (elastic#162063) ## Summary When users upgrade from `8.8.x` -> `8.9` version, users observe empty table as shown below. ![image](https://github.com/elastic/kibana/assets/7485038/20549edb-07b9-4124-a0ac-7515cf0e2796) Below are steps to reproduce this issue and test it: 1. Boot [email protected] 2. Clear Local storage. 3. Go to Security -> Alerts 4. Add Columns `_id` or any other column 5. Upgrade to `8.9` 6. The table will empty as shown in above screenshot. ## Fix This fix saperates out the migraton from 8.7 -> 8.8 and add a new migration for upgrading from 8.8 -> 8.9 `migrateAlertTableStateToTriggerActionsState` migrates table from `v8.7 -> v8.8`, `migrateTriggerActionsVisibleColumnsAlertTable88xTo89` migrates from `v8.8.x` -> `v8.9` Combining both of them may lead to issues when users are migrating from `v8.7` -> `v8.9` or `v8.8` -> `v8.9` (cherry picked from commit 0516cae)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…8.8.x -> 8.9 (#162063) (#162120) # Backport This will backport the following commits from `main` to `8.9`: - [[Security Solution][Fix] Empty Alert Table when upgrading from 8.8.x -> 8.9 (#162063)](#162063) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-07-18T08:57:12Z","message":"[Security Solution][Fix] Empty Alert Table when upgrading from 8.8.x -> 8.9 (#162063)\n\n## Summary\r\n\r\nWhen users upgrade from `8.8.x` -> `8.9` version, users observe empty\r\ntable as shown below.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/7485038/20549edb-07b9-4124-a0ac-7515cf0e2796)\r\n\r\n\r\nBelow are steps to reproduce this issue and test it:\r\n\r\n1. Boot [email protected]\r\n2. Clear Local storage.\r\n3. Go to Security -> Alerts\r\n4. Add Columns `_id` or any other column \r\n5. Upgrade to `8.9`\r\n6. The table will empty as shown in above screenshot.\r\n\r\n\r\n## Fix\r\n\r\nThis fix saperates out the migraton from 8.7 -> 8.8 and add a new\r\nmigration for upgrading from 8.8 -> 8.9\r\n\r\n`migrateAlertTableStateToTriggerActionsState` migrates table from `v8.7\r\n-> v8.8`,\r\n\r\n`migrateTriggerActionsVisibleColumnsAlertTable88xTo89` migrates from\r\n`v8.8.x` -> `v8.9`\r\n\r\nCombining both of them may lead to issues when users are migrating from\r\n`v8.7` -> `v8.9` or `v8.8` -> `v8.9`","sha":"0516caed1de3b72efa3f5c1282975c34962f7999","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Team:Threat Hunting:Investigations","v8.9.0","v8.10.0"],"number":162063,"url":"https://github.com/elastic/kibana/pull/162063","mergeCommit":{"message":"[Security Solution][Fix] Empty Alert Table when upgrading from 8.8.x -> 8.9 (#162063)\n\n## Summary\r\n\r\nWhen users upgrade from `8.8.x` -> `8.9` version, users observe empty\r\ntable as shown below.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/7485038/20549edb-07b9-4124-a0ac-7515cf0e2796)\r\n\r\n\r\nBelow are steps to reproduce this issue and test it:\r\n\r\n1. Boot [email protected]\r\n2. Clear Local storage.\r\n3. Go to Security -> Alerts\r\n4. Add Columns `_id` or any other column \r\n5. Upgrade to `8.9`\r\n6. The table will empty as shown in above screenshot.\r\n\r\n\r\n## Fix\r\n\r\nThis fix saperates out the migraton from 8.7 -> 8.8 and add a new\r\nmigration for upgrading from 8.8 -> 8.9\r\n\r\n`migrateAlertTableStateToTriggerActionsState` migrates table from `v8.7\r\n-> v8.8`,\r\n\r\n`migrateTriggerActionsVisibleColumnsAlertTable88xTo89` migrates from\r\n`v8.8.x` -> `v8.9`\r\n\r\nCombining both of them may lead to issues when users are migrating from\r\n`v8.7` -> `v8.9` or `v8.8` -> `v8.9`","sha":"0516caed1de3b72efa3f5c1282975c34962f7999"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/162063","number":162063,"mergeCommit":{"message":"[Security Solution][Fix] Empty Alert Table when upgrading from 8.8.x -> 8.9 (#162063)\n\n## Summary\r\n\r\nWhen users upgrade from `8.8.x` -> `8.9` version, users observe empty\r\ntable as shown below.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/7485038/20549edb-07b9-4124-a0ac-7515cf0e2796)\r\n\r\n\r\nBelow are steps to reproduce this issue and test it:\r\n\r\n1. Boot [email protected]\r\n2. Clear Local storage.\r\n3. Go to Security -> Alerts\r\n4. Add Columns `_id` or any other column \r\n5. Upgrade to `8.9`\r\n6. The table will empty as shown in above screenshot.\r\n\r\n\r\n## Fix\r\n\r\nThis fix saperates out the migraton from 8.7 -> 8.8 and add a new\r\nmigration for upgrading from 8.8 -> 8.9\r\n\r\n`migrateAlertTableStateToTriggerActionsState` migrates table from `v8.7\r\n-> v8.8`,\r\n\r\n`migrateTriggerActionsVisibleColumnsAlertTable88xTo89` migrates from\r\n`v8.8.x` -> `v8.9`\r\n\r\nCombining both of them may lead to issues when users are migrating from\r\n`v8.7` -> `v8.9` or `v8.8` -> `v8.9`","sha":"0516caed1de3b72efa3f5c1282975c34962f7999"}}]}] BACKPORT--> Co-authored-by: Jatin Kathuria <[email protected]>
…-> 8.9 (elastic#162063) ## Summary When users upgrade from `8.8.x` -> `8.9` version, users observe empty table as shown below. ![image](https://github.com/elastic/kibana/assets/7485038/20549edb-07b9-4124-a0ac-7515cf0e2796) Below are steps to reproduce this issue and test it: 1. Boot [email protected] 2. Clear Local storage. 3. Go to Security -> Alerts 4. Add Columns `_id` or any other column 5. Upgrade to `8.9` 6. The table will empty as shown in above screenshot. ## Fix This fix saperates out the migraton from 8.7 -> 8.8 and add a new migration for upgrading from 8.8 -> 8.9 `migrateAlertTableStateToTriggerActionsState` migrates table from `v8.7 -> v8.8`, `migrateTriggerActionsVisibleColumnsAlertTable88xTo89` migrates from `v8.8.x` -> `v8.9` Combining both of them may lead to issues when users are migrating from `v8.7` -> `v8.9` or `v8.8` -> `v8.9`
Summary
When users upgrade from
8.8.x
->8.9
version, users observe empty table as shown below.Below are steps to reproduce this issue and test it:
_id
or any other column8.9
Fix
This fix saperates out the migraton from 8.7 -> 8.8 and add a new migration for upgrading from 8.8 -> 8.9
migrateAlertTableStateToTriggerActionsState
migrates table fromv8.7 -> v8.8
,migrateTriggerActionsVisibleColumnsAlertTable88xTo89
migrates fromv8.8.x
->v8.9
Combining both of them may lead to issues when users are migrating from
v8.7
->v8.9
orv8.8
->v8.9