Move pending escalation into method on model
What does this MR do and why?
This MR moves the behavior for deleting pending escalations to a method on the pending escalation base class. This change makes it easier to delete pending escalations for multiple alerts or issues simultaneously with one SQL query. This will be taken advantage of in a future MR to remove an N+1 when processing alert notifications.
Related issue: https://gitlab.com/gitlab-org/gitlab/-/issues/348676
How to set up and validate locally
- Setup an escalation policy in a project for which you have maintainer+ permissions
- Setup the policy to immediately notify a user after 0 minutes, and again after 3 minutes
- Open an existing incident or create a new incident (new issue of type
incident
) - Set the
Escalation policy
on the incident - Mark the incident status as
Resolved
- The system notes on the incident should indicate that the user was notified only once. There should NOT be a 2nd notification after 3 minutes.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Sarah Yasonik