Commit 4d39e60
authored
fix(workflow-engine): Link cron monitor detectors to shadow alert workflows (#103919)
When creating a cron monitor with alert notifications via the old APIs,
a "shadow" alert rule is created which generates a Workflow, but the
DetectorWorkflow link between the cron Detector and the Workflow was
not being created.
Changes:
- Modified IssueAlertMigrator._create_detector_lookups() to find cron
detectors by extracting monitor.slug from rule conditions and querying
for the associated detector via DataSource
- Removed conditional check that was skipping
_connect_default_detectors()
for CRON_MONITOR rules, allowing detector linking to happen
- Used in_test_hide_transaction_boundary() to safely query across
databases
Part of [NEW-593: Cron Monitor Alerts are not linked to monitor when
created via the old
flow](https://linear.app/getsentry/issue/NEW-593/cron-monitor-alerts-are-not-linked-to-monitor-when-created-via-the-old)1 parent aff01be commit 4d39e60
File tree
2 files changed
+67
-3
lines changed- src/sentry/workflow_engine/migration_helpers
- tests/sentry/workflow_engine/migration_helpers
2 files changed
+67
-3
lines changedLines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
80 | 108 | | |
81 | 109 | | |
82 | 110 | | |
| |||
247 | 275 | | |
248 | 276 | | |
249 | 277 | | |
250 | | - | |
251 | | - | |
| 278 | + | |
252 | 279 | | |
253 | 280 | | |
254 | 281 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
442 | 479 | | |
443 | 480 | | |
444 | 481 | | |
| |||
0 commit comments