Skip to content

alert-mgmt-12: PATCH /rules bulk update handler#11

Open
sradco wants to merge 1 commit intoalert-mgmt-11-platform-updatefrom
alert-mgmt-12-bulk-update-handler
Open

alert-mgmt-12: PATCH /rules bulk update handler#11
sradco wants to merge 1 commit intoalert-mgmt-11-platform-updatefrom
alert-mgmt-12-bulk-update-handler

Conversation

@sradco
Copy link
Owner

@sradco sradco commented Feb 25, 2026

Alert Management API — Part 12/14: user-defined update + PATCH /rules (bulk)

Summary

  • PATCH /api/v1/alerting/rules bulk handler: accepts ruleIds array with label changes, drop/restore toggle, and classification patch
  • UpdateUserDefinedAlertRule: validates preconditions, updates PrometheusRule spec in-place, handles rule ID changes by migrating classification overrides
  • Bulk update orchestration: iterates rule IDs, attempts platform update first, falls back to user-defined on NotAllowedError
  • Label merge logic: fetches current rule via GetRuleById, merges with requested label set/unset operations
  • Classification override migration when rule ID changes due to label updates
  • Shared UpdateAlertRuleResponse type (also used by single-rule update in PR 14)
  • Unit tests for user-defined update, bulk handler, and classification migration

Dependencies

This PR is part of a stacked series. Please review in order.

  1. alert-mgmt-01: k8s foundation + health stub skeleton
    2–11. Pending — alert queries, relabel/health, management foundation, endpoints, create, delete, classification, platform update
  2. → This PR — user-defined update + PATCH /rules (bulk)
    13–14. Pending — docs/CI/e2e, single-rule API

@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 79de5cb to 0e38ca2 Compare February 25, 2026 22:35
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from e36d25b to 856bbfd Compare February 25, 2026 22:35
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 0e38ca2 to 4e064d9 Compare February 25, 2026 22:52
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 856bbfd to e1a7bdb Compare February 25, 2026 22:52
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 4e064d9 to aa28a8b Compare February 25, 2026 23:17
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from e1a7bdb to c55d856 Compare February 25, 2026 23:17
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from aa28a8b to fb62715 Compare February 25, 2026 23:34
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from c55d856 to 2325e45 Compare February 25, 2026 23:34
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from fb62715 to 9cd4085 Compare February 25, 2026 23:47
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 2325e45 to 018ba46 Compare February 25, 2026 23:47
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 9cd4085 to 3cfe659 Compare February 25, 2026 23:57
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 018ba46 to 204f240 Compare February 25, 2026 23:57
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 3cfe659 to 88846bb Compare February 26, 2026 14:42
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 204f240 to 05e7db5 Compare February 26, 2026 14:42
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 88846bb to b85c592 Compare February 26, 2026 14:47
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 05e7db5 to 0b77990 Compare February 26, 2026 14:47
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from b85c592 to 6f6cc32 Compare February 27, 2026 11:44
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 0b77990 to 5cfb683 Compare February 27, 2026 11:44
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 6f6cc32 to 5a9f130 Compare February 27, 2026 11:57
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 5cfb683 to 6897d28 Compare February 27, 2026 11:57
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 5a9f130 to 8302351 Compare February 27, 2026 11:59
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 6897d28 to 96629ef Compare February 27, 2026 11:59
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 8302351 to 09cf93a Compare February 27, 2026 12:10
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 96629ef to f595203 Compare February 27, 2026 12:10
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 09cf93a to 427d5b2 Compare February 27, 2026 12:29
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from f595203 to 51af654 Compare February 27, 2026 12:29
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 427d5b2 to f727831 Compare February 27, 2026 13:12
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch 2 times, most recently from 5d1c269 to 29f0dfc Compare March 1, 2026 19:05
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from f727831 to e85cd17 Compare March 1, 2026 19:05
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch 2 times, most recently from 8869060 to cfd5ea0 Compare March 1, 2026 21:08
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 083f542 to 4953fea Compare March 1, 2026 21:08
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from cfd5ea0 to d814f31 Compare March 2, 2026 09:26
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from 6b25100 to e020fed Compare March 2, 2026 10:04
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from d814f31 to 7d1dbf0 Compare March 2, 2026 10:04
Signed-off-by: Shirly Radco <sradco@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: Aviv Litman <alitman@redhat.com>
Co-authored-by: AI Assistant <noreply@cursor.com>
@sradco sradco force-pushed the alert-mgmt-12-bulk-update-handler branch from 7d1dbf0 to 6527edb Compare March 5, 2026 10:44
@sradco sradco force-pushed the alert-mgmt-11-platform-update branch from e020fed to beb842b Compare March 5, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant