Skip to content

[Security Solution] Prebuilt rule deprecation workflow automated tests#263662

Merged
dplumlee merged 7 commits into
elastic:mainfrom
dplumlee:deprecated-rules-tests
Apr 22, 2026
Merged

[Security Solution] Prebuilt rule deprecation workflow automated tests#263662
dplumlee merged 7 commits into
elastic:mainfrom
dplumlee:deprecated-rules-tests

Conversation

@dplumlee
Copy link
Copy Markdown
Contributor

@dplumlee dplumlee commented Apr 16, 2026

Summary

Adds unit tests, FTR integration tests, and cypress e2e tests for the prebuilt rule deprecation workflow feature in accordance to the test plan

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@dplumlee dplumlee self-assigned this Apr 16, 2026
@dplumlee dplumlee added release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area backport:version Backport to applied version labels v9.4.0 v9.5.0 labels Apr 16, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 16, 2026

Catch flakiness early (recommended)

Recommended before merge: run the flaky test runner against this PR to catch flakiness early.

Trigger a run with the Flaky Test Runner UI or post this comment on the PR:

/flaky ftrConfig:x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_basic_license.config.ts:30
/flaky ftrConfig:x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/serverless_essentials_tier.config.ts:30
/flaky ftrConfig:x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/upgrade_prebuilt_rules/configs/ess.config.ts:30
/flaky ftrConfig:x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/upgrade_prebuilt_rules/configs/serverless.config.ts:30

This check is experimental. Share your feedback in the #appex-qa channel.

Posted via Macroscope — Flaky Test Runner nudge

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#11680

[✅] x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/serverless_essentials_tier.config.ts: 25/25 tests passed.
[✅] x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_basic_license.config.ts: 25/25 tests passed.
[✅] x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/upgrade_prebuilt_rules/configs/ess.config.ts: 25/25 tests passed.
[✅] x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/upgrade_prebuilt_rules/configs/serverless.config.ts: 25/25 tests passed.

see run history

@dplumlee dplumlee marked this pull request as ready for review April 16, 2026 21:25
@dplumlee dplumlee requested review from a team as code owners April 16, 2026 21:25
@dplumlee dplumlee requested review from dhurley14 and sdesalas April 16, 2026 21:25
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@nikitaindik nikitaindik requested review from nikitaindik and removed request for sdesalas April 21, 2026 09:49
});
});

describe('With ids filter', () => {
Copy link
Copy Markdown
Contributor

@nikitaindik nikitaindik Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a small inconsistency with the test plan.

Given a non-existent rule SO id
When the user requests the deprecation review filtered to the non-existent id
Then the response contains an empty rules array

This would actually return a 400 with

{"message":"No rules found for bulk get","status_code":400}

You can repro by using "Copy as Fetch" in Network tab on a real request, then updating the id in the request.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I had meant to delete this, the behavior in the test plan is wrong. I've switched it over to the 400 error instead and added a specific test that lines up with the pattern we have in the endpoint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Cypress tests, I think it'd be a good idea to assert that success toasts appear after delete / duplicate+delete. This would give us reasonable confidence that operations actually succeeded.

@nikitaindik
Copy link
Copy Markdown
Contributor

Noticed that tests for count in the bootstrap endpoint are missing. Do we want to add them?

});
});

it('deletes a deprecated rule from its details page and navigates back to the rules list', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: If delete fails, we still navigate to the rules list. Should stay on the same page, imo.

@nikitaindik
Copy link
Copy Markdown
Contributor

Hey, @dplumlee! I reviewed, left a few suggestions / questions.

@dplumlee
Copy link
Copy Markdown
Contributor Author

Noticed that tests for count in the bootstrap endpoint are missing. Do we want to add them?

Added one in 00c7fbf

@dplumlee dplumlee requested a review from nikitaindik April 22, 2026 16:04
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 22, 2026

Follow-up: catch flakiness early for new cypress tests

Follow-up to the previous flaky test runner nudge, covering the new cypress specs added since then.

Trigger a run with the 一laky Test Runner UI or post this comment on the PR:

/flaky ftrConfig:x-pack/solutions/security/test/security_solution_cypress/cli_config.ts:30

Covers the two new ESS cypress specs under cypress/e2e/detection_response/rule_management/prebuilt_rules/deprecation/.

Share feedback in the #appex-qa channel.

Posted via Macroscope — Flaky Test Runner nudge

Copy link
Copy Markdown
Contributor

@nikitaindik nikitaindik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my feedback, @dplumlee! Coverage LGTM now.

@dplumlee dplumlee enabled auto-merge (squash) April 22, 2026 17:16
@dplumlee dplumlee merged commit 50dec39 into elastic:main Apr 22, 2026
17 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

https://github.com/elastic/kibana/actions/runs/24796786997

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @dplumlee

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@dplumlee dplumlee deleted the deprecated-rules-tests branch April 22, 2026 19:25
kibanamachine added a commit that referenced this pull request Apr 22, 2026
…d tests (#263662) (#265134)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Security Solution] Prebuilt rule deprecation workflow automated
tests (#263662)](#263662)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Davis
Plumlee","email":"56367316+dplumlee@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-22T18:55:44Z","message":"[Security
Solution] Prebuilt rule deprecation workflow automated tests
(#263662)\n\n## Summary\n\nAdds unit tests, FTR integration tests, and
cypress e2e tests for the\n[prebuilt rule deprecation
workflow\nfeature](#259673) in
accordance to\nthe [test
plan](https://github.com/elastic/kibana/pull/259855)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"50dec3989903fc92c789332ae72e22d93d09771b","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.4.0","v9.5.0"],"title":"[Security
Solution] Prebuilt rule deprecation workflow automated
tests","number":263662,"url":"https://github.com/elastic/kibana/pull/263662","mergeCommit":{"message":"[Security
Solution] Prebuilt rule deprecation workflow automated tests
(#263662)\n\n## Summary\n\nAdds unit tests, FTR integration tests, and
cypress e2e tests for the\n[prebuilt rule deprecation
workflow\nfeature](#259673) in
accordance to\nthe [test
plan](https://github.com/elastic/kibana/pull/259855)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"50dec3989903fc92c789332ae72e22d93d09771b"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/263662","number":263662,"mergeCommit":{"message":"[Security
Solution] Prebuilt rule deprecation workflow automated tests
(#263662)\n\n## Summary\n\nAdds unit tests, FTR integration tests, and
cypress e2e tests for the\n[prebuilt rule deprecation
workflow\nfeature](#259673) in
accordance to\nthe [test
plan](https://github.com/elastic/kibana/pull/259855)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"50dec3989903fc92c789332ae72e22d93d09771b"}}]}]
BACKPORT-->

Co-authored-by: Davis Plumlee <56367316+dplumlee@users.noreply.github.com>
smith pushed a commit to smith/kibana that referenced this pull request Apr 23, 2026
elastic#263662)

## Summary

Adds unit tests, FTR integration tests, and cypress e2e tests for the
[prebuilt rule deprecation workflow
feature](elastic#259673) in accordance to
the [test plan](elastic#259855)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
rbrtj pushed a commit to walterra/kibana that referenced this pull request Apr 27, 2026
elastic#263662)

## Summary

Adds unit tests, FTR integration tests, and cypress e2e tests for the
[prebuilt rule deprecation workflow
feature](elastic#259673) in accordance to
the [test plan](elastic#259855)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Apr 27, 2026
elastic#263662)

## Summary

Adds unit tests, FTR integration tests, and cypress e2e tests for the
[prebuilt rule deprecation workflow
feature](elastic#259673) in accordance to
the [test plan](elastic#259855)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants