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

[Security Solution] Deletes Old Timeline Code #196243

Merged
merged 10 commits into from
Nov 7, 2024

Conversation

logeekal
Copy link
Contributor

@logeekal logeekal commented Oct 15, 2024

Summary

Fixes https://github.com/elastic/security-team/issues/9676

This is follow up of the PR : #195959 where we had removed feature flag unifiedComponentsInTimelineDisabled.

This PR completes unified components migration in Timeline.

Changes

Most changes in this PR are :

  1. Deletion for the obsolete code.
  2. Refactoring of needed utils ( only 3. have marked in comments below )
  3. Updating import path of above utils.

logeekal added a commit that referenced this pull request Oct 24, 2024
…#195959)

## Summary

Handles elastic/security-team#9645

Follow Up PR for removal of Old timeline Code :
#196243

- This PR removes `unifiedComponentsInTimelineDisabled` flag. What this
means that that unified components in Timeline are now enabled by
default.

- Consequently, the old timeline table code becomes obsolete and is also
removed. ( #196243)

## Changes

1. Converted all cypress and jest tests that were testing old Timeline
table to test new unified components in Timeline. If the test for new
timeline already existed, old tests are also removed.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 24, 2024
…elastic#195959)

## Summary

Handles elastic/security-team#9645

Follow Up PR for removal of Old timeline Code :
elastic#196243

- This PR removes `unifiedComponentsInTimelineDisabled` flag. What this
means that that unified components in Timeline are now enabled by
default.

- Consequently, the old timeline table code becomes obsolete and is also
removed. ( elastic#196243)

## Changes

1. Converted all cypress and jest tests that were testing old Timeline
table to test new unified components in Timeline. If the test for new
timeline already existed, old tests are also removed.

(cherry picked from commit c41178d)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 24, 2024
…elastic#195959)

## Summary

Handles elastic/security-team#9645

Follow Up PR for removal of Old timeline Code :
elastic#196243

- This PR removes `unifiedComponentsInTimelineDisabled` flag. What this
means that that unified components in Timeline are now enabled by
default.

- Consequently, the old timeline table code becomes obsolete and is also
removed. ( elastic#196243)

## Changes

1. Converted all cypress and jest tests that were testing old Timeline
table to test new unified components in Timeline. If the test for new
timeline already existed, old tests are also removed.

(cherry picked from commit c41178d)
kibanamachine added a commit that referenced this pull request Oct 24, 2024
…abled` flag (#195959) (#197693)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Remove
`unifiedComponentsInTimelineDisabled` flag
(#195959)](#195959)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jatin
Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T16:41:19Z","message":"[Security
Solution] Remove `unifiedComponentsInTimelineDisabled` flag
(#195959)\n\n## Summary\r\n\r\nHandles
https://github.com/elastic/security-team/issues/9645\r\n\r\nFollow Up PR
for removal of Old timeline Code
:\r\nhttps://github.com//pull/196243\r\n\r\n- This PR
removes `unifiedComponentsInTimelineDisabled` flag. What this\r\nmeans
that that unified components in Timeline are now enabled
by\r\ndefault.\r\n\r\n- Consequently, the old timeline table code
becomes obsolete and is also\r\nremoved. (
https://github.com/elastic/kibana/pull/196243)\r\n\r\n##
Changes\r\n\r\n1. Converted all cypress and jest tests that were testing
old Timeline\r\ntable to test new unified components in Timeline. If the
test for new\r\ntimeline already existed, old tests are also
removed.","sha":"c41178d2d6e952798548ccd7db691d5ceff62053","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","v8.16.0"],"title":"[Security Solution] Remove
`unifiedComponentsInTimelineDisabled`
flag","number":195959,"url":"https://github.com/elastic/kibana/pull/195959","mergeCommit":{"message":"[Security
Solution] Remove `unifiedComponentsInTimelineDisabled` flag
(#195959)\n\n## Summary\r\n\r\nHandles
https://github.com/elastic/security-team/issues/9645\r\n\r\nFollow Up PR
for removal of Old timeline Code
:\r\nhttps://github.com//pull/196243\r\n\r\n- This PR
removes `unifiedComponentsInTimelineDisabled` flag. What this\r\nmeans
that that unified components in Timeline are now enabled
by\r\ndefault.\r\n\r\n- Consequently, the old timeline table code
becomes obsolete and is also\r\nremoved. (
https://github.com/elastic/kibana/pull/196243)\r\n\r\n##
Changes\r\n\r\n1. Converted all cypress and jest tests that were testing
old Timeline\r\ntable to test new unified components in Timeline. If the
test for new\r\ntimeline already existed, old tests are also
removed.","sha":"c41178d2d6e952798548ccd7db691d5ceff62053"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195959","number":195959,"mergeCommit":{"message":"[Security
Solution] Remove `unifiedComponentsInTimelineDisabled` flag
(#195959)\n\n## Summary\r\n\r\nHandles
https://github.com/elastic/security-team/issues/9645\r\n\r\nFollow Up PR
for removal of Old timeline Code
:\r\nhttps://github.com//pull/196243\r\n\r\n- This PR
removes `unifiedComponentsInTimelineDisabled` flag. What this\r\nmeans
that that unified components in Timeline are now enabled
by\r\ndefault.\r\n\r\n- Consequently, the old timeline table code
becomes obsolete and is also\r\nremoved. (
https://github.com/elastic/kibana/pull/196243)\r\n\r\n##
Changes\r\n\r\n1. Converted all cypress and jest tests that were testing
old Timeline\r\ntable to test new unified components in Timeline. If the
test for new\r\ntimeline already existed, old tests are also
removed.","sha":"c41178d2d6e952798548ccd7db691d5ceff62053"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
kibanamachine added a commit that referenced this pull request Oct 24, 2024
…sabled&#x60; flag (#195959) (#197692)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security Solution] Remove
&#x60;unifiedComponentsInTimelineDisabled&#x60; flag
(#195959)](#195959)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jatin
Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T16:41:19Z","message":"[Security
Solution] Remove `unifiedComponentsInTimelineDisabled` flag
(#195959)\n\n## Summary\r\n\r\nHandles
https://github.com/elastic/security-team/issues/9645\r\n\r\nFollow Up PR
for removal of Old timeline Code
:\r\nhttps://github.com//pull/196243\r\n\r\n- This PR
removes `unifiedComponentsInTimelineDisabled` flag. What this\r\nmeans
that that unified components in Timeline are now enabled
by\r\ndefault.\r\n\r\n- Consequently, the old timeline table code
becomes obsolete and is also\r\nremoved. (
https://github.com/elastic/kibana/pull/196243)\r\n\r\n##
Changes\r\n\r\n1. Converted all cypress and jest tests that were testing
old Timeline\r\ntable to test new unified components in Timeline. If the
test for new\r\ntimeline already existed, old tests are also
removed.","sha":"c41178d2d6e952798548ccd7db691d5ceff62053","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","v8.16.0"],"title":"[Security Solution] Remove
`unifiedComponentsInTimelineDisabled`
flag","number":195959,"url":"https://github.com/elastic/kibana/pull/195959","mergeCommit":{"message":"[Security
Solution] Remove `unifiedComponentsInTimelineDisabled` flag
(#195959)\n\n## Summary\r\n\r\nHandles
https://github.com/elastic/security-team/issues/9645\r\n\r\nFollow Up PR
for removal of Old timeline Code
:\r\nhttps://github.com//pull/196243\r\n\r\n- This PR
removes `unifiedComponentsInTimelineDisabled` flag. What this\r\nmeans
that that unified components in Timeline are now enabled
by\r\ndefault.\r\n\r\n- Consequently, the old timeline table code
becomes obsolete and is also\r\nremoved. (
https://github.com/elastic/kibana/pull/196243)\r\n\r\n##
Changes\r\n\r\n1. Converted all cypress and jest tests that were testing
old Timeline\r\ntable to test new unified components in Timeline. If the
test for new\r\ntimeline already existed, old tests are also
removed.","sha":"c41178d2d6e952798548ccd7db691d5ceff62053"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195959","number":195959,"mergeCommit":{"message":"[Security
Solution] Remove `unifiedComponentsInTimelineDisabled` flag
(#195959)\n\n## Summary\r\n\r\nHandles
https://github.com/elastic/security-team/issues/9645\r\n\r\nFollow Up PR
for removal of Old timeline Code
:\r\nhttps://github.com//pull/196243\r\n\r\n- This PR
removes `unifiedComponentsInTimelineDisabled` flag. What this\r\nmeans
that that unified components in Timeline are now enabled
by\r\ndefault.\r\n\r\n- Consequently, the old timeline table code
becomes obsolete and is also\r\nremoved. (
https://github.com/elastic/kibana/pull/196243)\r\n\r\n##
Changes\r\n\r\n1. Converted all cypress and jest tests that were testing
old Timeline\r\ntable to test new unified components in Timeline. If the
test for new\r\ntimeline already existed, old tests are also
removed.","sha":"c41178d2d6e952798548ccd7db691d5ceff62053"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
@logeekal logeekal force-pushed the delete/old_timeline_code branch from 37e7723 to 4ab5f0b Compare November 6, 2024 13:50
* 2.0.
*/

import type { TimelineNonEcsData } from '@kbn/timelines-plugin/common';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a utility that was part of on of the deleted file but is required at other places as well so moved here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8ec47e8

@@ -282,3 +282,14 @@ export const TIMELINE_FILTER_DROP_AREA = 'timeline-filter-drop-area';

export const getNonDropAreaFilters = (filters: Filter[] = []) =>
filters.filter((f: Filter) => f.meta.controlledBy !== TIMELINE_FILTER_DROP_AREA);

export const isFullScreen = ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a utility that was part of on of the deleted file but is required at other places as well so moved here.

Copy link
Contributor

Choose a reason for hiding this comment

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

could maybe add a couple of unit tests for it, even though it's super simple?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done here : f8a4121

@logeekal logeekal added backport release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Investigations Team v8.17.0 labels Nov 6, 2024
@logeekal logeekal marked this pull request as ready for review November 6, 2024 15:28
@logeekal logeekal requested review from a team as code owners November 6, 2024 15:28
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations)

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

left a couple of comments for adding unit tests, about to pull down the branch and test things, will approve once desk testing is done

Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think about writing some basic unit tests for the 2 methods here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Should not have missed that. Will add those.

@@ -282,3 +282,14 @@ export const TIMELINE_FILTER_DROP_AREA = 'timeline-filter-drop-area';

export const getNonDropAreaFilters = (filters: Filter[] = []) =>
filters.filter((f: Filter) => f.meta.controlledBy !== TIMELINE_FILTER_DROP_AREA);

export const isFullScreen = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

could maybe add a couple of unit tests for it, even though it's super simple?

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

thanks for adding the tests. I did some smoke testing and everything looks good. Such a cool PR, over 7k lines removed, LOVE IT!

@logeekal logeekal enabled auto-merge (squash) November 6, 2024 16:43
@logeekal logeekal merged commit c9d167f into elastic:main Nov 7, 2024
42 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11721344293

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 6139 6122 -17

Async chunks

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

id before after diff
securitySolution 21.0MB 13.4MB -7.6MB
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 552 550 -2

References to deprecated APIs

id before after diff
securitySolution 450 448 -2

Total ESLint disabled count

id before after diff
securitySolution 638 636 -2

History

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 7, 2024
## Summary

Fixes elastic/security-team#9676

This is follow up of the PR :
elastic#195959 where we had removed
feature flag `unifiedComponentsInTimelineDisabled`.

This PR completes unified components migration in Timeline.

## Changes

Most changes in this PR are :

1. Deletion for the obsolete code.
2. Refactoring of needed utils ( only 3. have marked in comments below )
3. Updating import path of above utils.

(cherry picked from commit c9d167f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 7, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Deletes Old Timeline Code
(#196243)](#196243)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jatin
Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2024-11-07T10:39:55Z","message":"[Security
Solution] Deletes Old Timeline Code (#196243)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/security-team/issues/9676\r\n\r\nThis is
follow up of the PR :\r\nhttps://github.com//pull/195959
where we had removed\r\nfeature flag
`unifiedComponentsInTimelineDisabled`.\r\n\r\nThis PR completes unified
components migration in Timeline. \r\n\r\n## Changes\r\n\r\nMost changes
in this PR are : \r\n\r\n1. Deletion for the obsolete code.\r\n2.
Refactoring of needed utils ( only 3. have marked in comments below
)\r\n3. Updating import path of above
utils.","sha":"c9d167f1ab584c315f820dc94ba2d51864d508f4","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","v8.17.0"],"title":"[Security Solution] Deletes
Old Timeline
Code","number":196243,"url":"https://github.com/elastic/kibana/pull/196243","mergeCommit":{"message":"[Security
Solution] Deletes Old Timeline Code (#196243)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/security-team/issues/9676\r\n\r\nThis is
follow up of the PR :\r\nhttps://github.com//pull/195959
where we had removed\r\nfeature flag
`unifiedComponentsInTimelineDisabled`.\r\n\r\nThis PR completes unified
components migration in Timeline. \r\n\r\n## Changes\r\n\r\nMost changes
in this PR are : \r\n\r\n1. Deletion for the obsolete code.\r\n2.
Refactoring of needed utils ( only 3. have marked in comments below
)\r\n3. Updating import path of above
utils.","sha":"c9d167f1ab584c315f820dc94ba2d51864d508f4"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196243","number":196243,"mergeCommit":{"message":"[Security
Solution] Deletes Old Timeline Code (#196243)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/security-team/issues/9676\r\n\r\nThis is
follow up of the PR :\r\nhttps://github.com//pull/195959
where we had removed\r\nfeature flag
`unifiedComponentsInTimelineDisabled`.\r\n\r\nThis PR completes unified
components migration in Timeline. \r\n\r\n## Changes\r\n\r\nMost changes
in this PR are : \r\n\r\n1. Deletion for the obsolete code.\r\n2.
Refactoring of needed utils ( only 3. have marked in comments below
)\r\n3. Updating import path of above
utils.","sha":"c9d167f1ab584c315f820dc94ba2d51864d508f4"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
mbondyra pushed a commit to mbondyra/kibana that referenced this pull request Nov 8, 2024
## Summary

Fixes elastic/security-team#9676

This is follow up of the PR :
elastic#195959 where we had removed
feature flag `unifiedComponentsInTimelineDisabled`.

This PR completes unified components migration in Timeline. 

## Changes

Most changes in this PR are : 

1. Deletion for the obsolete code.
2. Refactoring of needed utils ( only 3. have marked in comments below )
3. Updating import path of above utils.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Investigations Team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants