Skip to content

[8.x] [ResponseOps][Alerts] Move the alerts table to a dedicated package (#207878)#210895

Merged
umbopepato merged 5 commits intoelastic:8.xfrom
umbopepato:backport/8.x/pr-207878
Feb 13, 2025
Merged

[8.x] [ResponseOps][Alerts] Move the alerts table to a dedicated package (#207878)#210895
umbopepato merged 5 commits intoelastic:8.xfrom
umbopepato:backport/8.x/pr-207878

Conversation

@umbopepato
Copy link
Copy Markdown
Member

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…lastic#207878)

## Summary

This PR turns the AlertsTable into a standalone component, making it
independent from the `TriggersActionsUI` plugin.

#### Removes the alerts table registry

All configuration is now managed through the AlertsTable component
props. Shared configurations are handled by giving consumers the ability
to directly provide alerts table wrapper components (see for example the
`renderAlertsTable` prop of `getCases`).

#### Moves the alerts table to dedicated package(s)

Following the feature-driven structure we're introducing for ResponseOps
(alerting) client-side packages:
- `@kbn/response-ops-alerts-table`
- `@kbn/response-ops-alerts-apis`
- `@kbn/response-ops-alerts-fields-browser`

#### Initial work on improving composition and organization

- Reorganizes the table code into a by-entity-type folder structure
(`components/`, `hooks/`, ...)
- Simplifies some components and breaks into smaller units when possible

## To verify

For consumers of the alerts table:
- Check that all your tables have the same behavior as before (columns,
sort, row actions, bulk actions, etc.)
- Check that your "shared" tables (i.e. cases alerts view in O11y and
Security) have the expected configuration and behavior

> [!WARNING]
> This PR moves a lot of files. Git might not always recognize the
correct delete/add file pairs. If you see weird diffs feel free to reach
out for help!

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Identify risks

| Risk | Description | Severity | Mitigation |
|---|---|---|---|
| Table misconfigurations | Some table configurations might slightly
differ from the previous AlertsTableRegistry-backed version | Low |
Quick fix |

## References

Closes elastic#195180

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
(cherry picked from commit a74066d)

# Conflicts:
#	.github/CODEOWNERS
#	packages/response-ops/alerts_table/components/alert_lifecycle_status_cell.tsx
#	src/platform/packages/shared/kbn-alerts-ui-shared/src/alert_fields_table/index.tsx
#	x-pack/platform/plugins/private/translations/translations/zh-CN.json
#	x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.tsx
#	x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/index.tsx
#	x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.tsx
#	x-pack/test/functional_with_es_ssl/apps/cases/group1/view_case.ts
@umbopepato umbopepato added the backport This PR is a backport of another PR label Feb 12, 2025
@umbopepato umbopepato enabled auto-merge (squash) February 12, 2025 17:26
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Feb 12, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Feb 13, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Investigations - Security Solution Cypress Tests #8 / Detections : Page Filters with data modification should update alert status list when the alerts are updated should update alert status list when the alerts are updated

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
alerting 219 218 -1
cases 842 1023 +181
ml 2204 2419 +215
observability 1257 1352 +95
securitySolution 6731 6814 +83
slo 956 955 -1
threatIntelligence 138 176 +38
triggersActionsUi 868 856 -12
total +598

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/alerting-types 241 248 +7
@kbn/alerts-ui-shared 287 282 -5
@kbn/response-ops-alerts-fields-browser - 6 +6
@kbn/response-ops-alerts-table - 6 +6
observability 706 715 +9
ruleRegistry 222 221 -1
triggersActionsUi 570 543 -27
total -5

Async chunks

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

id before after diff
apm 2.6MB 2.6MB -226.0B
cases 540.7KB 1.3MB ⚠️ +802.0KB
cloudSecurityPosture 522.6KB 522.6KB +15.0B
discover 838.2KB 838.2KB +15.0B
infra 1.7MB 1.7MB -335.0B
ml 4.7MB 5.5MB ⚠️ +795.6KB
observability 1.3MB 1.4MB +88.6KB
securitySolution 18.7MB 16.2MB -2.5MB
slo 848.1KB 848.3KB +168.0B
synthetics 903.9KB 903.7KB -226.0B
threatIntelligence 57.7KB 758.1KB ⚠️ +700.3KB
triggersActionsUi 1.7MB 1.6MB -38.4KB
total -250.6KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/response-ops-alerts-apis - 1 +1
@kbn/response-ops-alerts-fields-browser - 2 +2
@kbn/response-ops-alerts-table - 13 +13
@kbn/securitysolution-data-table 6 10 +4
triggersActionsUi 51 40 -11
total +9

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cases 162.7KB 164.1KB +1.4KB
esqlDataGrid 9.4KB 9.4KB +15.0B
ml 78.6KB 79.9KB +1.3KB
observability 103.0KB 103.1KB +108.0B
securitySolution 91.8KB 91.3KB -511.0B
threatIntelligence 12.7KB 12.8KB +102.0B
triggersActionsUi 127.7KB 116.2KB -11.5KB
total -9.1KB
Unknown metric groups

API count

id before after diff
@kbn/alerting-types 244 252 +8
@kbn/alerts-ui-shared 303 298 -5
@kbn/response-ops-alerts-fields-browser - 15 +15
@kbn/response-ops-alerts-table - 8 +8
observability 714 723 +9
triggersActionsUi 596 561 -35
total -0

async chunk count

id before after diff
cases 32 34 +2
ml 110 111 +1
observability 21 24 +3
securitySolution 107 108 +1
triggersActionsUi 65 58 -7
total -0

ESLint disabled in files

id before after diff
@kbn/response-ops-alerts-apis - 1 +1
@kbn/response-ops-alerts-table - 2 +2
total +3

ESLint disabled line counts

id before after diff
@kbn/response-ops-alerts-fields-browser - 1 +1
@kbn/response-ops-alerts-table - 8 +8
cases 64 65 +1
observability 42 46 +4
triggersActionsUi 130 120 -10
total +4

miscellaneous assets size

id before after diff
cases 0.0B 126.3KB +126.3KB
ml 211.1KB 337.5KB +126.3KB
total +252.6KB

References to deprecated APIs

id before after diff
@kbn/response-ops-alerts-table - 15 +15
triggersActionsUi 27 10 -17
total -2

Total ESLint disabled count

id before after diff
@kbn/response-ops-alerts-apis - 1 +1
@kbn/response-ops-alerts-fields-browser - 1 +1
@kbn/response-ops-alerts-table - 10 +10
cases 82 83 +1
observability 43 47 +4
triggersActionsUi 135 125 -10
total +7

History

@umbopepato umbopepato merged commit f1d1557 into elastic:8.x Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants