Add tables/models for IssuableEscalationStatus & IssuableEscalations
Motivation
These tables and models represent the data structures required to escalate manually created incidents according to escalation policies. The primary goal of this issue is to unblock the next pieces of work so that they can be taken in parallel.
These tables will be used with the logic built in #330281 (closed).
Scope
- Add 2 new tables.
- Add 2 new models & validations.
- Add relevant associations to existing models.
Implementation Plan
Table: incident_management_issuable_escalation_statuses
Model: IncidentManagement::IssuableEscalationStatus
| Column | Required | Type | Description |
|---|---|---|---|
| id | true | Integer | ID of the object |
| issue_id | true | Integer | Incident which has an escalation status |
| status | true | Integer | One of AlertManagement::Alert::STATUSES
|
Validations/constraints:
-
issue,statusshould both be present -
statusshould be inAlertManagement::Alert::STATUSES - Unique constraint:
issue_idshould be unique
Table: incident_management_issuable_escalations
Model: IncidentManagement::IssuableEscalations
| Column | Required | Type | Description |
|---|---|---|---|
| id | true | Integer | ID of the escalation |
| policy_id | true | Integer | Escalation Policy to which the escalation corresponds |
| issue_id | true | Integer | ID of the escalate-able IssuableEscalationStatus
|
| created_at | true | datetime_with_zone | Creation time of the escalation (AKA - time at which the escalation was "triggered") |
| updated_at | true | datetime_with_zone | Update time of the escalation (AKA - time at which notifications were last sent out) |
Validations/constraints:
-
issue,policyshould both be present - Unique constraint:
issue_idshould be unique - Test/confirm that adding
IssuableEscalationdoes not break the Protect stage's implementation for Alerts. Additional context. Docs.
Edited by Thiago Figueiró