elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.67k stars 8.23k forks source link

force version non conflict diff when base version is missing #201301

Open maximpn opened 6 hours ago

maximpn commented 6 hours ago

Resolves: https://github.com/elastic/kibana/issues/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.

elasticmachine commented 6 hours ago

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

elasticmachine commented 6 hours ago

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

elasticmachine commented 6 hours ago

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

elasticmachine commented 5 hours ago

:broken_heart: Build Failed

Failed CI Steps

Test Failures

Metrics [docs]

✅ unchanged

History

cc @maximpn