elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.35k stars 7.98k forks source link

[Cloud Security] Disable/Enable rule takes too long #182768

Open seanrathier opened 1 week ago

seanrathier commented 1 week ago

Summary

This change resolves the Benchmark Rules page's performance when enabling or disabling rules. Most of the work was converting the change_csp_rule_state to use the ReactQuery useMutation hook. This change introduces optimistic updating of the cached data, while at the same time performing the HTTP request to bulk update to mute or unmute the rules.

Should anything fail with the HTP request, the snapshot of the data taken before the cache was optimistically updated will replace the mutated data.

Other changes:

https://github.com/elastic/kibana/assets/4624273/43a0d7e8-cd20-4cc8-8213-aa600d74efff

Checklisthttps://github.com/elastic/kibana/pull/182768/files

For maintainers

seanrathier commented 1 week ago

/ci

elasticmachine commented 1 week ago

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

seanrathier commented 1 week ago

/ci

kibana-ci commented 2 days ago

:yellow_heart: Build succeeded, but was flaky

Failed CI Steps

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
cloudSecurityPosture 448.5KB 448.7KB +190.0B

History

To update your PR or re-run it, just comment with: @elasticmachine merge upstream