Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.9] [Security Solution] Fix flaky test: x-pack/test/detection_engine_api_integration/security_and_spaces/update_prebuilt_rules_package/update_prebuilt_rules_package·ts - update_prebuilt_rules_package should allow user to install prebuilt rules from scratch, then install new rules and upgrade existing rules from the new package #164558

Merged
merged 5 commits into from
Aug 24, 2023

Conversation

jpdjere
Copy link
Contributor

@jpdjere jpdjere commented Aug 23, 2023

NOTE: This is a manual backport of #163241. It had to be done manually because of changes that happened from 8.9 -> 8.10 like the common folder restructuring and some type changes because of the OpenAPI effort, but it is mostly the changes to the same files as that PR.

Original PR description follows:

Fixes: #162658

Summary

  • Fixes flaky test: x-pack/test/detection_engine_api_integration/security_and_spaces/update_prebuilt_rules_package/update_prebuilt_rules_package·ts
  • Test title: update_prebuilt_rules_package should allow user to install prebuilt rules from scratch, then install new rules and upgrade existing rules from the new package

Passing flaky test runner

300 runs: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2799

Root cause and what this PR does

Refactor

  • Moves the refreshing of the indexes within the utility function that write to indexes:
    • installPrebuiltRules
    • upgradePrebuiltRules
    • installPrebuiltRulesAndTimelines (legacy, but still used)
    • installPrebuiltRulesFleetPackage
  • Creates 2 new utils:
    • installPrebuiltRulesPackageByVersion, which installs security_detection_engine package via Fleet API, with its version passed in as param
    • getInstalledRules, reusable function to fetch all installed rules

@jpdjere jpdjere self-assigned this Aug 23, 2023
@jpdjere jpdjere added backport failed-test A test failure on a tracked branch, potentially flaky-test release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team:Detection Rule Management Security Detection Rule Management Team labels Aug 23, 2023
@elasticmachine
Copy link
Contributor

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

@jpdjere jpdjere added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Aug 23, 2023
@elasticmachine
Copy link
Contributor

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

@jpdjere jpdjere added the test label Aug 23, 2023
@jpdjere jpdjere requested a review from maximpn August 23, 2023 10:55
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 13 15 +2
securitySolution 416 420 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 14 16 +2
securitySolution 497 501 +4
total +6

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jpdjere

@jpdjere jpdjere merged commit 949e663 into elastic:8.9 Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport failed-test A test failure on a tracked branch, potentially flaky-test 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. test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants