Skip to content

Shorten error messages for escalation rule count and fix edge case

Sarah Yasonik requested to merge sy-abbreviate-escalation-rule-limit into master

What does this MR do?

Context

This MR relates to the Category:Incident Management feature set, specifically on-call schedule management and escalation policies. These allow users to route notifications regarding system alerts to the right people, by defining "Escalation Rules".

Changes

This refactors the error handling for the upper limit of escalation rules per policy, moving the check from the model validations into the create/update services.

  1. this brings the error message earlier in the flow, so we don't try to create all of the new escalation rules individually
    • trying to create each rule takes unneeded time, and results in an error-per-rule, instead of a single error
  2. there was something funky in the logic of the validation, causing it to behave inconsistently
    • I was able to create >10 rules for a policy, as well as blocked with <10 (all during policy edits) - I'm still not entirely sure why, but moving the logic simplifies it

Screenshots or Screencasts (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Sarah Yasonik

Merge request reports