Skip to content

[Fleet] Reconcile disabled materialized alerting rules to the shipped template on reinstall - #290709

Draft
patrykkopycinski wants to merge 1 commit into
elastic:mainfrom
patrykkopycinski:feat/fleet-alerting-rule-template-reconcile
Draft

[Fleet] Reconcile disabled materialized alerting rules to the shipped template on reinstall#290709
patrykkopycinski wants to merge 1 commit into
elastic:mainfrom
patrykkopycinski:feat/fleet-alerting-rule-template-reconcile

Conversation

@patrykkopycinski

Copy link
Copy Markdown
Contributor

Summary

On package reinstall, disabled materialized alerting rules are reconciled to the shipped template instead of drifting.

Extracted from the SDLC visibility-platform POC.

Evidence

  • 14 rules verified on dogfood instance post-reinstall (RUN5)

Draft — extracted from a larger POC branch; not ready for review.

…e on reinstall

createAlertingRuleFromTemplate early-returned when the materialized rule already
existed, so a reinstall never propagated template changes to existing installs.
Live proof of the bug: the sdlc-sync-health rule shipped threshold [0] but the
materialized rule stayed at a drifted [999] across reinstalls.

Now, when the rule already exists AND has never been enabled (its params are
exactly what the template produced at install time, so there is no operator
config to lose), overwrite name/tags/schedule/params from the shipped template.
A rule that has been enabled may have been deliberately tuned by an admin, so it
is left untouched. `enabled` is not updatable via rulesClient.update and is
preserved automatically.

Verified live: drifted the disabled rule to [999], re-uploaded the sdlc_intel
zip, and the rule reconciled back to the shipped [0] on reinstall.

Tests: added "should reconcile a still-disabled existing rule back to the
shipped template params" and "should NOT reconcile an enabled existing rule".
Mutation-tested: stubbing the reconcile branch red->green.

(cherry picked from commit c55106c)
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant