Skip to content

Conversation

@evanpurkhiser
Copy link
Member

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

…kflows

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)
@evanpurkhiser evanpurkhiser requested a review from a team as a code owner November 24, 2025 20:38
@linear
Copy link

linear bot commented Nov 24, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 24, 2025
@evanpurkhiser evanpurkhiser merged commit 4d39e60 into master Nov 25, 2025
97 of 99 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/fix-workflow-engine-link-cron-monitor-detectors-to-shadow-alert-workflows branch November 25, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants