Skip to content

Conversation

@maximpn
Copy link
Contributor

@maximpn maximpn commented Jul 31, 2025

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

…ic#228620)

**Addresses: elastic#202078

## Summary

This PR implements Prebuilt Rules Upgrade [with (via Prebuilt Rule Upgrade Flyout)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_upgrade_with_preview.md) and [without (via Prebuilt Rules Upgrade table)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_upgrade_without_preview.md) preview test plans.

## Details

Since some of the test scenarios had been implemented earlier this PR involves refactoring as well and tests reorganization. The following has been done in the scope

- Prebuilt Rules Installation and Prebuilt Rules Upgrade workflows in Cypress have been split
- Existing tests were renamed to better match to the test plans
- Prebuilt Rules Upgrade Cypress tests were reorganized to
   - `upgrade_with_preview.cy.ts` - Upgrade via Prebuilt Rule Upgrade Flyout
   - `upgrade_without_preview.cy.ts` - Upgrade via via Prebuilt Rules Upgrade table
 - Missing tests have been added to the corresponding files for Jest Integration and Cypress tests

## Not implemented test scenarios

The following test scenarios weren't implemented due to time constraints

- [Prebuilt rules upgrade with preview test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_upgrade_with_preview.md#concurrency-control) (Upgrade via Prebuilt Rule Upgrade Flyout)
  - **Concurrency control** e2e tests
    The tests verify that a toast message appears after either prebuilt rule has been edited (revision bump) or a new prebuilt rule version is available (version bump, a new prebuilt rules package version has been installed). Since UI refetches data every 5 minutes e2e tests either has to wait for ~5 minutes for toasts to appear or use `cy.clock()` to mock timers. The latter doesn't work in a simple way and requires time for deeper investigation.

   But there are [unit tests](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.test.ts) for concurrency control.

- [Prebuilt rules upgrade without preview test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_upgrade_without_preview.md) (Prebuilt Rules Bulk upgrade)
  - **Rule upgrade workflow: filtering, sorting, pagination**
    There are two existing table filtering tests but besides that no new tests has been added. These tests should be covered in the scope of elastic#166215.
  - **Rule upgrade workflow: Edge cases**/**Scenario: Rule bound data is preserved after upgrading a rule to a newer version**
  - **Error handling**/**Scenario: Error is handled when any upgrade operation on prebuilt rules fails**
  - **Licensing: API endpoints**

## Flaky test runner

- ✅  [e2e Cypress tests Rule Management group](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8812) (100 runs)

(cherry picked from commit 67006ad)

# Conflicts:
#	x-pack/solutions/security/plugins/security_solution/public/common/test/eui/combobox.ts
@maximpn maximpn requested a review from kibanamachine as a code owner July 31, 2025 18:03
@maximpn maximpn added the backport This PR is a backport of another PR label Jul 31, 2025
@maximpn maximpn enabled auto-merge (squash) July 31, 2025 18:03
@maximpn maximpn force-pushed the backport/9.0/pr-228620 branch from f611d73 to 6eefb8e Compare August 1, 2025 14:19
@elasticmachine
Copy link
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 +595.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 594 597 +3

Total ESLint disabled count

id before after diff
securitySolution 677 680 +3

History

@maximpn maximpn merged commit b059023 into elastic:9.0 Aug 1, 2025
10 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants