Skip to content

[8.18] [Security Solution] Implement prebuilt rules upgrade test plan (#228620)#230115

Merged
maximpn merged 2 commits intoelastic:8.18from
maximpn:backport/8.18/pr-228620
Aug 1, 2025
Merged

[8.18] [Security Solution] Implement prebuilt rules upgrade test plan (#228620)#230115
maximpn merged 2 commits intoelastic:8.18from
maximpn:backport/8.18/pr-228620

Conversation

@maximpn
Copy link
Copy Markdown
Contributor

@maximpn maximpn commented Jul 31, 2025

Backport

This will backport the following commits from main to 8.18:

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:04
@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:04
@maximpn maximpn force-pushed the backport/8.18/pr-228620 branch from 99d8ab4 to f71a4f1 Compare August 1, 2025 14:21
@maximpn maximpn force-pushed the backport/8.18/pr-228620 branch from f71a4f1 to a5ebd2d Compare August 1, 2025 16:08
@maximpn maximpn merged commit 118dbe8 into elastic:8.18 Aug 1, 2025
9 checks passed
@elasticmachine
Copy link
Copy Markdown
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 9.1MB 9.1MB +597.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 595 598 +3

Total ESLint disabled count

id before after diff
securitySolution 678 681 +3

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants