[Fleet] Reconcile disabled materialized alerting rules to the shipped template on reinstall - #290709
Draft
patrykkopycinski wants to merge 1 commit into
Draft
Conversation
…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)
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Draft — extracted from a larger POC branch; not ready for review.