[ResponseOps] Some rules are getting skipped when performing bulkEnableRules
and bulkDisableRules
#181050
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Alerting/RulesFramework
Issues related to the Alerting Rules Framework
sdh-linked
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
Related to: #177634
Summary
When performing bulk enable or disable operations, some rules are getting skipped. For the bulk enable operation, it skips all rules that are already enabled, and for bulk disable, it skips those that are already disabled. This behavior creates several issues when using the rules client.
1. Inconsistent responses from RulesCLient
If you call
rulesClient.bulkEnableRules({ ids: ['ruleId1', 'ruleId2'] })
with the same arguments but affected rules in different enabled/disabled states, you can get three different responses, making this call non-idempotent. Here are some examples:Both rules initially disabled:
One rule disabled, one enabled:
Both rules initially enabled:
Expected responses
I expect the rules passed as params to end up either in the
errors
array or therules
array in the returned object regardless of their initial state.2. Discrepancy between the rule state and task manager
When enabling rules, the Alerting framework skips rules if their saved object has
alert.attributes.enabled: true
. This behavior creates issues described here and in the attached SDH. There might be a situation where a rule is marked as enabled, but no corresponding task exists in the Task Manager. In the UI, these rules will appear enabled but will never run. Users expect that all rules affected by the bulk enable action will get a corresponding task created in the Task Manager and be scheduled for execution. Therefore, it would be best to also check if the rules to be enabled have tasks in the Task Manager, instead of relying solely on the rule's current enabled state.The text was updated successfully, but these errors were encountered: