Skip to content

[8.18] [Security Solution] Extend rule upgrade integration tests for prebuilt rule customization feature (#209260)#212283

Merged
maximpn merged 1 commit intoelastic:8.18from
maximpn:backport/8.18/pr-209260
Feb 24, 2025
Merged

[8.18] [Security Solution] Extend rule upgrade integration tests for prebuilt rule customization feature (#209260)#212283
maximpn merged 1 commit intoelastic:8.18from
maximpn:backport/8.18/pr-209260

Conversation

@maximpn
Copy link
Copy Markdown
Contributor

@maximpn maximpn commented Feb 24, 2025

Backport

This will backport the following commits from main to 8.18:

Questions ?

Please refer to the Backport tool documentation

…t rule customization feature (elastic#209260)

**Addresses:** elastic#202078
**Partially implements test plan:** elastic#205922

## Summary

This PR implements the Rule Upgrade test plan added in elastic#205922 and elastic#203331.

## Details

Tests cover only enabled customization and organized in a following way

- `diffable_rule_fields` folder contains per field tests. It focuses on `DiffableRule`* fields. Each field has rule preview and upgrade scenarios throughly covered. Assertion on stats are included in rule preview tests to make sure the maximum coverage with reasonable execution time. **Diffable rule fields` tests were moved to a separate execution group to avoid exceeding execution limits.**
- `preview_prebuilt_rules_upgrade.ts` integration tests on `/internal/prebuilt_rules/upgrade/_review` endpoint. It uses only `name` and `tags` fields to minimize tests complexity. Basically it should be considered as smoke tests.
- `upgrade_prebuilt_rules` integrations test on `/internal/prebuilt_rules/upgrade/_perform` endpoint.  It uses only `name` and `tags` fields to minimize tests complexity. Basically it should be considered as smoke tests.

This PR supersedes elastic#205217 and elastic#205339.

* `DiffableRule` was added in the scope of prebuilt rules customization epic to serve rule upgrades preview and performing upgrades. It represents slightly reorganized rule fields to simplify prebuilt rule upgrade workflow handling. There are utility functions transforming between `RuleResponse` and `DiffableRule`.

## Flaky test runner

Flaky test runs for 100 iterations were successful (elastic#209260 (comment) and elastic#209260 (comment)).

(cherry picked from commit 4909770)

# Conflicts:
#	x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/customization_enabled/upgrade_perform_prebuilt_rules.all_rules_mode.ts
#	x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/customization_enabled/upgrade_perform_prebuilt_rules.specific_rules_mode.ts
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

@maximpn maximpn merged commit b7b034f into elastic:8.18 Feb 24, 2025
12 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