kibana/packages
Edgar Santos e585c2223d
Add UI for bulk fill gaps (#224585)
## Summary

This draft PR adds the UI to bulk gap filling gaps. This action can be
triggered from the "rules management" table as well as from the gaps
table in the "execution results" tab for any rule.

# How to test
Make sure your `kibana.dev.yaml` contains the following feature flags:
`storeGapsInEventLogEnabled` and `bulkFillRuleGapsEnabled`.

You can just paste this string in the file:
```
xpack.securitySolution.enableExperimental: [ 'storeGapsInEventLogEnabled', 'bulkFillRuleGapsEnabled' ]
```
## Bulk gap filling from the "rules management" table
1. Generate 100 rules, each with 1000 gaps using [this
tool](https://github.com/elastic/security-documents-generator).
`yarn start rules --rules 100 -g 1000 -c -i"5m"`
2. Navigate to the rules management table at
`/app/security/rules/management`
3. Select some rules, click on "Bulk actions" and then on "Fill gaps"

![image](https://github.com/user-attachments/assets/f5d9bcb6-9139-43cb-b023-f1f63a9b8b7a)
4. Select the time window and click on "Run"

![image](https://github.com/user-attachments/assets/0269d00a-2750-4b2d-975e-0ebfbac27e16)
5. You should see a confirmation toast showing that 3 rules were
successfully scheduled

![image](https://github.com/user-attachments/assets/9800c9e2-3c3e-4b87-96e4-17c84f1b024a)
6. Click on any of the rules for which you just executed a gaps fill and
check its gaps by going to "Execution results" and scrolling down to the
"Gaps" table. You can see that the gaps covering the time range you
selected are marked as "in progress"

![image](https://github.com/user-attachments/assets/850dea1c-12cc-46c5-8675-d11445218c24)

If you select one or more rules that are disabled, you should see this
modal:

![image](https://github.com/user-attachments/assets/4a820b92-a9f0-4529-93ee-1fbaf7552888)


## Bulk filling from a rule gaps table
1. From the "rules management" table, click on any rule that has gaps.
2. Click on the "execution results" tab
3. Scroll down to the gaps table, you should see a "Fill all gaps"
button.
4. Click on it and select the time range.

![image](https://github.com/user-attachments/assets/375b0677-9b49-43e4-8820-5186c9343891)
5. If you select a big time range, you should see a toast indicating
that the scheduling is in progress after 5 seconds (you can hit this
case by generating 10000 gaps for 1 rule)

![image](https://github.com/user-attachments/assets/6d6345d9-fbc6-4c14-9c2d-04f40941fd17)

6. You should see a success toast once it is done

![image](https://github.com/user-attachments/assets/089ec2b9-daa5-44df-bfc0-84c69e2f6eec)

---------

Co-authored-by: Khristinin Nikita <nikita.khristinin@elastic.co>
2025-06-23 23:00:17 +02:00
..
kbn-babel-preset Revert "Update dependency monaco-editor to ^0.52.2 (main) (#206176)" (#222854) 2025-06-06 12:36:00 +02:00
kbn-bazel-runner Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-capture-oas-snapshot-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-check-mappings-update-cli [Fleet] Save package policy previous revision on package upgrade (#222779) 2025-06-20 10:37:23 +02:00
kbn-check-prod-native-modules-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-ci-stats-performance-metrics Disable allowAbsoluteUrls for axios (#215138) 2025-03-25 09:52:36 +01:00
kbn-ci-stats-shipper-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-cli-dev-mode [Kibana Dev Server] Fix DELETE requests without a body in Safari (#220899) 2025-05-20 09:35:30 +02:00
kbn-dependency-ownership Add conditional switching between EUI releases (#219818) 2025-05-28 15:41:19 +02:00
kbn-dependency-usage SKA: Extract list of Kibana solutions into a dedicated package (#213353) 2025-03-20 10:20:07 +01:00
kbn-docs-utils [Lint] Officially deprecate Enzyme (#221779) 2025-06-03 12:15:37 +02:00
kbn-eslint-config [Authz] Cleanup of access tags functionality and documentation (#220231) 2025-05-22 08:45:17 +02:00
kbn-eslint-plugin-disable Add ESLINT constraints to detect inter-group dependencies (#194810) 2024-10-22 06:34:19 -05:00
kbn-eslint-plugin-eslint [Lint] Officially deprecate Enzyme (#221779) 2025-06-03 12:15:37 +02:00
kbn-eslint-plugin-eui-a11y Add support for wrapping elements in eslint-plugin-eui-a11y plugin (#216339) 2025-04-09 18:16:00 +02:00
kbn-eslint-plugin-i18n Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-visualizations (#202754) 2025-01-08 12:19:24 +01:00
kbn-eslint-plugin-imports SKA: Extract list of Kibana solutions into a dedicated package (#213353) 2025-03-20 10:20:07 +01:00
kbn-eslint-plugin-telemetry [chore] Reuse bundled lodash and lodash/fp dependency (#217467) 2025-04-17 14:54:25 +02:00
kbn-failed-test-reporter-cli Disable allowAbsoluteUrls for axios (#215138) 2025-03-25 09:52:36 +01:00
kbn-find-used-node-modules Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-generate SKA: Extract list of Kibana solutions into a dedicated package (#213353) 2025-03-20 10:20:07 +01:00
kbn-generate-console-definitions SKA: Categorise remaining packages (#205875) 2025-01-08 22:20:14 +01:00
kbn-import-locator Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-json-ast Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-kibana-manifest-schema SKA: Extract list of Kibana solutions into a dedicated package (#213353) 2025-03-20 10:20:07 +01:00
kbn-lint-packages-cli [codeowners] Filter kibanamachine (#199404) 2024-11-12 12:39:17 -06:00
kbn-lint-ts-projects-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-lock-manager [LockManager] Update token and metadata when an expired lock is re-acquired (#220476) 2025-05-08 19:40:20 +02:00
kbn-managed-vscode-config SKA: Misc cleanup and enhancements (#212207) 2025-02-24 13:31:00 +00:00
kbn-managed-vscode-config-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-manifest Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-mock-idp-plugin [workchat] Initial FTR test setup (#216828) 2025-04-09 10:31:12 +02:00
kbn-optimizer Add UI for bulk fill gaps (#224585) 2025-06-23 23:00:17 +02:00
kbn-peggy-loader SKA: Relocate "platform" packages that remain on /packages (#208704) 2025-02-24 11:03:30 +00:00
kbn-performance-testing-dataset-extractor [CI tools] Use ES 8.x (#213056) 2025-03-05 20:26:57 +01:00
kbn-picomatcher Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-plugin-check SKA: Categorise remaining packages (#205875) 2025-01-08 22:20:14 +01:00
kbn-plugin-generator SKA: Extract list of Kibana solutions into a dedicated package (#213353) 2025-03-20 10:20:07 +01:00
kbn-plugin-helpers Clean up REACT_18=true variable (#213246) 2025-03-05 17:40:05 +01:00
kbn-relocate SKA: Extract list of Kibana solutions into a dedicated package (#213353) 2025-03-20 10:20:07 +01:00
kbn-repo-file-maps Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-repo-linter Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-repo-source-classifier [ska] update paths, kibana.jsons for test plugins (#223004) 2025-06-10 22:00:02 +02:00
kbn-repo-source-classifier-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-set-map SKA: Categorise remaining packages (#205875) 2025-01-08 22:20:14 +01:00
kbn-sort-package-json Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-styled-components-mapping-cli SKA: Relocate "platform" packages that remain on /packages (#208704) 2025-02-24 11:03:30 +00:00
kbn-ts-projects Dependency usage CLI (#198920) 2024-11-25 14:07:40 +01:00
kbn-ts-type-check-cli [1chat] MCP Server that can expose 1chat tools (#222231) 2025-06-11 15:16:08 +02:00
kbn-validate-next-docs-cli [ci] Work around docosaurus errors (#206097) 2025-01-09 16:33:30 -06:00
kbn-web-worker-stub Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-whereis-pkg-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-yarn-lock-validator Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00