Skip to content

[8.17] [Security Solution] Unlock Prebuil Rules Customization workflow for rules with missing base version (#201301)#201656

Merged
kibanamachine merged 1 commit intoelastic:8.17from
kibanamachine:backport/8.17/pr-201301
Nov 25, 2024
Merged

[8.17] [Security Solution] Unlock Prebuil Rules Customization workflow for rules with missing base version (#201301)#201656
kibanamachine merged 1 commit intoelastic:8.17from
kibanamachine:backport/8.17/pr-201301

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.17:

Questions ?

Please refer to the Backport tool documentation

…ules with missing base version (elastic#201301)

**Resolves: elastic#200904

## Summary

This PR unlocks Prebuilt Rules Customization workflow for rules with missing base version.

## Details

Each Prebuilt Rule update contains `version` diff. `version` is a special non-customizable field we use to track prebuilt rule version. It always gets target rule version's value after rule upgrade.

A generic `numberDiffAlgorithm` algorithm was used for `version` field. It produces a `SOLVABLE` conflict when rule's base version is missing. It blocked the workflow in UI. We check the number of field with conflicts versus resolved conflicts to decide when a rule is ready for upgrade. In case `version` field got a conflict user had no possibility to resolve it.

The fix adds a new `forceTargetVersionDiffAlgorithm` diff algorithm applied only for `version` field. It produces a non-conflict diff all the time even when base version is missing. The reason behind is that `version` always gets target rule's version.

(cherry picked from commit dea9312)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Nov 25, 2024
@kibanamachine kibanamachine enabled auto-merge (squash) November 25, 2024 17:17
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @maximpn

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