oncall-engine/engine/apps/alerts/tasks
Matias Bordese fa815b7ecd
Reworked declare incident escalation step (#5130)
Reworked https://github.com/grafana/oncall/pull/5047. Main update is the
switch from FK to a [M2M
relation](https://docs.google.com/document/d/1HeulqxoFShSHtInQrZNJLL5MDlHPNT50rVGaK3zZWvw/edit?disco=AAABVLjV4W8)
(which doesn't really change the original/intended behavior, besides not
needing to alter the alert group table, and it is a bit more flexible;
the extra table shouldn't introduce issues because this is used only for
tracking purposes and the information needed in the log record is
already there).

Avoid a db migration involving alert group table:

```
--
-- Create model RelatedIncident
--
CREATE TABLE `alerts_relatedincident` (`id` bigint AUTO_INCREMENT NOT NULL PRIMARY KEY, `incident_id` varchar(50) NOT NULL, `created_at` datetime(6) NOT NULL, `is_active` bool NOT NULL, `channel_filter_id` bigint NULL, `organization_id` bigint NOT NULL);
CREATE TABLE `alerts_relatedincident_attached_alert_groups` (`id` bigint AUTO_INCREMENT NOT NULL PRIMARY KEY, `relatedincident_id` bigint NOT NULL, `alertgroup_id` bigint NOT NULL);
ALTER TABLE `alerts_relatedincident` ADD CONSTRAINT `alerts_relatedincident_organization_id_incident_id_d7fc9a4f_uniq` UNIQUE (`organization_id`, `incident_id`);
ALTER TABLE `alerts_relatedincident` ADD CONSTRAINT `alerts_relatedincide_channel_filter_id_9556c836_fk_alerts_ch` FOREIGN KEY (`channel_filter_id`) REFERENCES `alerts_channelfilter` (`id`);
ALTER TABLE `alerts_relatedincident` ADD CONSTRAINT `alerts_relatedincide_organization_id_74ed6bed_fk_user_mana` FOREIGN KEY (`organization_id`) REFERENCES `user_management_organization` (`id`);
CREATE INDEX `alerts_relatedincident_incident_id_8356a799` ON `alerts_relatedincident` (`incident_id`);
ALTER TABLE `alerts_relatedincident_attached_alert_groups` ADD CONSTRAINT `alerts_relatedincident_a_relatedincident_id_alert_3d683baa_uniq` UNIQUE (`relatedincident_id`, `alertgroup_id`);
ALTER TABLE `alerts_relatedincident_attached_alert_groups` ADD CONSTRAINT `alerts_relatedincide_relatedincident_id_3e5e7a23_fk_alerts_re` FOREIGN KEY (`relatedincident_id`) REFERENCES `alerts_relatedincident` (`id`);
ALTER TABLE `alerts_relatedincident_attached_alert_groups` ADD CONSTRAINT `alerts_relatedincide_alertgroup_id_0125deca_fk_alerts_al` FOREIGN KEY (`alertgroup_id`) REFERENCES `alerts_alertgroup` (`id`);
```
2024-10-07 19:26:10 +00:00
..
__init__.py Reworked declare incident escalation step (#5130) 2024-10-07 19:26:10 +00:00
acknowledge_reminder.py Add transaction on_commit before signals for alert group actions (#3731) 2024-01-31 15:54:50 -07:00
alert_group_web_title_cache.py remove references to AlertGroup.is_archived and AlertGroup.unarchived_objects (#2524) 2023-07-18 11:48:34 +00:00
call_ack_url.py apps.get_model -> import (#2619) 2023-07-25 09:43:23 +00:00
check_escalation_finished.py Update escalation auditor logs to expose succeeding count (#4431) 2024-05-31 18:29:31 +00:00
compare_escalations.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
custom_webhook_result.py Add escalation chain support for new webhooks (#1654) 2023-04-05 12:03:55 +00:00
declare_incident.py Reworked declare incident escalation step (#5130) 2024-10-07 19:26:10 +00:00
delete_alert_group.py Add transaction on_commit before signals for alert group actions (#3731) 2024-01-31 15:54:50 -07:00
distribute_alert.py Handle alert group deleted when task is already queued (#4230) 2024-04-16 14:39:00 +00:00
escalate_alert_group.py Update transaction.on_commit to use partial instead of lambda (#3448) 2023-11-29 12:01:30 +00:00
invite_user_to_join_incident.py apps.get_model -> import (#2619) 2023-07-25 09:43:23 +00:00
maintenance.py Update transaction.on_commit to use partial instead of lambda (#3448) 2023-11-29 12:01:30 +00:00
notify_all.py Fix order filtering when executing notify all/group steps from snapshot (#4381) 2024-05-23 12:36:28 +00:00
notify_group.py fix failing e2e tests 2024-07-08 13:04:16 -04:00
notify_ical_schedule_shift.py Speed up internal api endpoints (#4830) 2024-08-15 14:20:55 +00:00
notify_user.py Fix direct paging ack (#4957) 2024-08-30 09:17:09 +00:00
resolve_alert_group_by_source_if_needed.py Minor formatting changes (#2641) 2023-07-26 14:45:44 +01:00
resolve_by_last_step.py apps.get_model -> import (#2619) 2023-07-25 09:43:23 +00:00
send_alert_group_signal.py Add transaction on_commit before signals for alert group actions (#3731) 2024-01-31 15:54:50 -07:00
send_update_log_report_signal.py Fix task retries for deleted alert groups (#3553) 2023-12-12 12:01:47 +00:00
send_update_resolution_note_signal.py apps.get_model -> import (#2619) 2023-07-25 09:43:23 +00:00
sync_grafana_alerting_contact_points.py Remove deprecated alerting integration tasks (#2944) 2023-09-01 13:11:02 +00:00
task_logger.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
unsilence.py Update transaction.on_commit to use partial instead of lambda (#3448) 2023-11-29 12:01:30 +00:00
wipe.py Improve alert group deletion API (#3124) 2023-10-05 14:32:40 +01:00