Create database tables for escalation policies and rules
What does this MR do?
This adds two tables needed for the Escalation Policies epic.
Model: IncidentManagement::EscalationPolicy
Column | Required | Type |
---|---|---|
id |
true | Integer |
project_id |
true | Integer |
name |
true | text |
description |
false | text |
Validations/constraints:
-
project
,name
should be present -
name
length should be under 72 chars -
description
length should be under 160 chars - Must have at least one
EscalationRule
- Unique constraint:
name
should be unique within the project.
incident_management_escalation_rules
Table: Model: IncidentManagement::EscalationRule
Column | Required | Type | Description |
---|---|---|---|
id |
true | Integer | |
policy_id |
true | Integer |
IncidentManagement::EscalationPolicy to which the escalation rule belongs |
status |
true | Integer | One of AlertManagement::Alert::STATUSES values for either :acknowlegded or :resolved
|
elapsed_time |
true | Integer | Time in minutes from the creation of an alert at which this rule should be enacted |
schedule_id |
true | Integer |
IncidentManagement::OncallSchedule which should be notified in escalation rule |
Validations/constraints:
-
project
,status
,elapsed_time
,schedule
should all be present -
schedule_id
should belong to the project of escalation policy -
status
should be one ofAlertManagement::Alert::STATUSES
values for either:acknowlegded
or:resolved
(one of[1, 2]
) -
elapsed_time
should be an integer >= 0 & <= 24.hours - Unique constraint: Combo of
policy_id, status, elapsed_time, schedule_id
should be unique. This is all the attributes. Is there a simple way to do this? Should we allow duplicate rules?
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
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
Related to #323138 (closed)
Edited by Sean Arnold