Skip to content

[8.x] [ResponseOps][Rules] Create Rules APIs package (#214187)#216006

Merged
umbopepato merged 7 commits intoelastic:8.xfrom
umbopepato:backport/8.x/pr-214187
Mar 26, 2025
Merged

[8.x] [ResponseOps][Rules] Create Rules APIs package (#214187)#216006
umbopepato merged 7 commits intoelastic:8.xfrom
umbopepato:backport/8.x/pr-214187

Conversation

@umbopepato
Copy link
Member

Backport

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

Questions ?

Please refer to the Backport tool documentation

## Summary

- Creates a `@kbn/response-ops-rules-apis` package, following the
proposed structure for ResponseOps Management Experiences package.
- Moves relevant rules API fetchers and react-query hooks to the new
package.
- Adds an internal variant of the `/api/alerting/rule_types` endpoint
(`/internal/alerting/_rule_types`), that returns the same value as the
public one + the newly added internal [`solution`
field](elastic#212017), that we don't
want to expose publicly.

## Verification steps

1. Create rules that fire alerts
2. Verify the usages of the moved/changed hooks, with limited privileges
as well (i.e. only `Rules Settings` but not `Stack Rules`):
2.1. Stack management and Observability rules, rule details and alerts
pages
2.2. Rules tab in the Connector editor flyout
2.3. Alerts table row actions (••• icon)
2.4. Tags filter in the rules list page
3. Using the DevTools, compare the response of the public and internal
`rule_types` endpoins:
    ```
    GET kbn:/api/alerting/rule_types
    GET kbn:/internal/alerting/_rule_types
    ```
Checking that the `solution` field is present only in the internal one

## References

Closes elastic#213059

### Checklist

- [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7aac590)

# Conflicts:
#	.github/CODEOWNERS
#	x-pack/platform/plugins/shared/alerting/common/routes/rule/apis/list_types/schemas/v1.ts
#	x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/rule_types_internal.ts
#	x-pack/test/alerting_api_integration/security_and_spaces/group5/tests/alerting/index.ts
#	x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/get_rule_tags.ts
@umbopepato umbopepato added the backport This PR is a backport of another PR label Mar 26, 2025
@umbopepato umbopepato enabled auto-merge (squash) March 26, 2025 10:15
@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Mar 26, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@umbopepato umbopepato merged commit 3fddba1 into elastic:8.x Mar 26, 2025
8 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
alerting 226 229 +3
apm 1927 1930 +3
cases 1013 1016 +3
discover 1249 1252 +3
embeddableAlertsTable 281 286 +5
infra 1747 1750 +3
ml 2435 2440 +5
monitoring 734 737 +3
observability 1253 1258 +5
observabilityLogsExplorer 431 434 +3
securitySolution 7136 7139 +3
slo 1125 1128 +3
synthetics 1240 1243 +3
transform 717 720 +3
triggersActionsUi 835 839 +4
uptime 813 816 +3
total +55

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 248 249 +1
triggersActionsUi 525 520 -5
total -4

Async chunks

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

id before after diff
alerting 94.4KB 94.7KB +276.0B
apm 2.6MB 2.6MB +374.0B
cases 1.3MB 1.3MB +287.0B
discover 1003.7KB 1004.1KB +379.0B
embeddableAlertsTable 803.8KB 804.1KB +390.0B
infra 1.6MB 1.6MB +376.0B
ml 5.4MB 5.4MB +416.0B
monitoring 664.9KB 665.2KB +376.0B
observability 1.3MB 1.3MB +224.0B
observabilityLogsExplorer 268.4KB 268.8KB +482.0B
securitySolution 9.1MB 9.1MB +295.0B
slo 918.3KB 918.6KB +376.0B
synthetics 1.1MB 1.1MB +376.0B
transform 632.4KB 632.8KB +376.0B
triggersActionsUi 1.5MB 1.5MB +665.0B
uptime 533.9KB 534.2KB +376.0B
total +5.9KB

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
alerting 52 51 -1

Page load bundle

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

id before after diff
observability 93.9KB 93.9KB -1.0B
observabilityLogsExplorer 15.1KB 14.9KB -146.0B
triggersActionsUi 108.5KB 107.0KB -1.5KB
total -1.7KB
Unknown metric groups

API count

id before after diff
@kbn/alerting-types 252 253 +1
triggersActionsUi 531 526 -5
total -4

ESLint disabled in files

id before after diff
@kbn/response-ops-rules-apis - 2 +2

ESLint disabled line counts

id before after diff
@kbn/test-suites-xpack 754 756 +2

Total ESLint disabled count

id before after diff
@kbn/response-ops-rules-apis - 2 +2
@kbn/test-suites-xpack 780 782 +2
total +4

History

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:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants