Skip to content

[Security Solution] clean unused types, export components and add many unit tests#217100

Merged
PhilippeOberti merged 3 commits intoelastic:mainfrom
PhilippeOberti:grouped-alert-table
Apr 4, 2025
Merged

[Security Solution] clean unused types, export components and add many unit tests#217100
PhilippeOberti merged 3 commits intoelastic:mainfrom
PhilippeOberti:grouped-alert-table

Conversation

@PhilippeOberti
Copy link
Copy Markdown
Contributor

@PhilippeOberti PhilippeOberti commented Apr 3, 2025

Summary

This code change was originally part of a bigger PR related to the AI for SOC effort. I decided to split the work for 2 reasons:

  • less files to review, less teams impacted
  • this current PR will easily be backported to 8.x while the AI for SOC is only targeting 9.1

This PR makes only a few small changes:

  • remove unused types
  • export a few components/functions outside of the alerts_table folder to make them reusable within the new AI for SOC alert summary page (see PR linked above)
  • add a lot of unit tests to everything, especially the now exported components/functions

UI remains unchanged:

Screenshot 2025-04-03 at 6 09 57 PM
Screenshot 2025-04-03 at 6 10 06 PM
Screenshot 2025-04-03 at 6 10 13 PM
Screenshot 2025-04-03 at 6 10 21 PM

Checklist

Will unblock https://github.com/elastic/security-team/issues/11973

@PhilippeOberti PhilippeOberti added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Apr 3, 2025
@PhilippeOberti PhilippeOberti marked this pull request as ready for review April 3, 2025 21:36
@PhilippeOberti PhilippeOberti requested review from a team as code owners April 3, 2025 21:36
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

@lgestc lgestc 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 the cleanup 💪

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 8.9MB 8.9MB -671.0B

History

@PhilippeOberti PhilippeOberti merged commit 837059b into elastic:main Apr 4, 2025
9 checks passed
@PhilippeOberti PhilippeOberti deleted the grouped-alert-table branch April 4, 2025 19:11
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 217100

Questions ?

Please refer to the Backport tool documentation

@PhilippeOberti
Copy link
Copy Markdown
Contributor Author

💚 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

PhilippeOberti added a commit to PhilippeOberti/kibana that referenced this pull request Apr 4, 2025
…y unit tests (elastic#217100)

## Summary

This code change was originally part of [a bigger
PR](elastic#216744) related to the AI for
SOC effort. I decided to split the work for 2 reasons:
- less files to review, less teams impacted
- this current PR will easily be backported to `8.x` while the AI for
SOC is only targeting `9.1`

This PR makes only a few small changes:
- remove unused types
- export a few components/functions outside of the `alerts_table` folder
to make them reusable within the new AI for SOC alert summary page (see
PR linked above)
- add a lot of unit tests to everything, especially the now exported
components/functions

#### UI remains unchanged:

![Screenshot 2025-04-03 at 6 09
57 PM](https://github.com/user-attachments/assets/3e4135e7-6e2f-4b4f-94e5-0dd72f1710bb)
![Screenshot 2025-04-03 at 6 10
06 PM](https://github.com/user-attachments/assets/382391d6-7ae1-4da4-a76f-495b6db69db3)
![Screenshot 2025-04-03 at 6 10
13 PM](https://github.com/user-attachments/assets/28c5947b-2168-4080-b298-5fea1f3f97c7)
![Screenshot 2025-04-03 at 6 10
21 PM](https://github.com/user-attachments/assets/2dc75fcb-9929-4821-830d-b84fceaf232d)

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Will unblock elastic/security-team#11973

(cherry picked from commit 837059b)

# Conflicts:
#	src/platform/packages/shared/kbn-grouping/src/containers/query/index.test.ts
#	src/platform/packages/shared/kbn-grouping/src/mocks.ts
PhilippeOberti added a commit that referenced this pull request Apr 4, 2025
…dd many unit tests (#217100) (#217253)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] clean unused types, export components and add
many unit tests
(#217100)](#217100)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Philippe
Oberti","email":"philippe.oberti@elastic.co"},"sourceCommit":{"committedDate":"2025-04-04T19:11:23Z","message":"[Security
Solution] clean unused types, export components and add many unit tests
(#217100)\n\n## Summary\n\nThis code change was originally part of [a
bigger\nPR](#216744) related to
the AI for\nSOC effort. I decided to split the work for 2 reasons:\n-
less files to review, less teams impacted\n- this current PR will easily
be backported to `8.x` while the AI for\nSOC is only targeting
`9.1`\n\nThis PR makes only a few small changes:\n- remove unused
types\n- export a few components/functions outside of the `alerts_table`
folder\nto make them reusable within the new AI for SOC alert summary
page (see\nPR linked above)\n- add a lot of unit tests to everything,
especially the now exported\ncomponents/functions\n\n#### UI remains
unchanged:\n\n![Screenshot 2025-04-03 at 6
09\n57 PM](https://github.com/user-attachments/assets/3e4135e7-6e2f-4b4f-94e5-0dd72f1710bb)\n![Screenshot
2025-04-03 at 6
10\n06 PM](https://github.com/user-attachments/assets/382391d6-7ae1-4da4-a76f-495b6db69db3)\n![Screenshot
2025-04-03 at 6
10\n13 PM](https://github.com/user-attachments/assets/28c5947b-2168-4080-b298-5fea1f3f97c7)\n![Screenshot
2025-04-03 at 6
10\n21 PM](https://github.com/user-attachments/assets/2dc75fcb-9929-4821-830d-b84fceaf232d)\n\n###
Checklist\n\n- [x] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\nWill unblock
https://github.com/elastic/security-team/issues/11973","sha":"837059bcfa83db2ee997c8febace8111e345a12f","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting:Investigations","backport:version","v9.1.0","v8.19.0"],"title":"[Security
Solution] clean unused types, export components and add many unit
tests","number":217100,"url":"https://github.com/elastic/kibana/pull/217100","mergeCommit":{"message":"[Security
Solution] clean unused types, export components and add many unit tests
(#217100)\n\n## Summary\n\nThis code change was originally part of [a
bigger\nPR](#216744) related to
the AI for\nSOC effort. I decided to split the work for 2 reasons:\n-
less files to review, less teams impacted\n- this current PR will easily
be backported to `8.x` while the AI for\nSOC is only targeting
`9.1`\n\nThis PR makes only a few small changes:\n- remove unused
types\n- export a few components/functions outside of the `alerts_table`
folder\nto make them reusable within the new AI for SOC alert summary
page (see\nPR linked above)\n- add a lot of unit tests to everything,
especially the now exported\ncomponents/functions\n\n#### UI remains
unchanged:\n\n![Screenshot 2025-04-03 at 6
09\n57 PM](https://github.com/user-attachments/assets/3e4135e7-6e2f-4b4f-94e5-0dd72f1710bb)\n![Screenshot
2025-04-03 at 6
10\n06 PM](https://github.com/user-attachments/assets/382391d6-7ae1-4da4-a76f-495b6db69db3)\n![Screenshot
2025-04-03 at 6
10\n13 PM](https://github.com/user-attachments/assets/28c5947b-2168-4080-b298-5fea1f3f97c7)\n![Screenshot
2025-04-03 at 6
10\n21 PM](https://github.com/user-attachments/assets/2dc75fcb-9929-4821-830d-b84fceaf232d)\n\n###
Checklist\n\n- [x] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\nWill unblock
https://github.com/elastic/security-team/issues/11973","sha":"837059bcfa83db2ee997c8febace8111e345a12f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217100","number":217100,"mergeCommit":{"message":"[Security
Solution] clean unused types, export components and add many unit tests
(#217100)\n\n## Summary\n\nThis code change was originally part of [a
bigger\nPR](#216744) related to
the AI for\nSOC effort. I decided to split the work for 2 reasons:\n-
less files to review, less teams impacted\n- this current PR will easily
be backported to `8.x` while the AI for\nSOC is only targeting
`9.1`\n\nThis PR makes only a few small changes:\n- remove unused
types\n- export a few components/functions outside of the `alerts_table`
folder\nto make them reusable within the new AI for SOC alert summary
page (see\nPR linked above)\n- add a lot of unit tests to everything,
especially the now exported\ncomponents/functions\n\n#### UI remains
unchanged:\n\n![Screenshot 2025-04-03 at 6
09\n57 PM](https://github.com/user-attachments/assets/3e4135e7-6e2f-4b4f-94e5-0dd72f1710bb)\n![Screenshot
2025-04-03 at 6
10\n06 PM](https://github.com/user-attachments/assets/382391d6-7ae1-4da4-a76f-495b6db69db3)\n![Screenshot
2025-04-03 at 6
10\n13 PM](https://github.com/user-attachments/assets/28c5947b-2168-4080-b298-5fea1f3f97c7)\n![Screenshot
2025-04-03 at 6
10\n21 PM](https://github.com/user-attachments/assets/2dc75fcb-9929-4821-830d-b84fceaf232d)\n\n###
Checklist\n\n- [x] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\nWill unblock
https://github.com/elastic/security-team/issues/11973","sha":"837059bcfa83db2ee997c8febace8111e345a12f"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants