Skip to content

Conversation

@ofir-frd
Copy link

Benchmark PR getsentry#104004

Type: Clean (correct implementation)

Original PR Title: feat(crons): Always create detectors for all monitors in MonitorValidator
Original PR Description: Previously, detectors were created as part of the endpoint, after detector → alerts linking happened. This changes it so detectors are crated immediately after the cron monitor is created.

Changes:

  • Moved ensure_cron_detector() call from endpoint into MonitorValidator.create()
  • Detector is created BEFORE alert_rule creation, allowing IssueAlertMigrator
    to find and link it to workflows
  • Added skip_detector_creation context flag to prevent duplicate creation
    when using MonitorDataSourceValidator (new detector flow)
  • Updated tests to verify detector creation

This ensures both the old (MonitorValidator) and new (detector API) flows
correctly create detectors for all monitors.

Part of NEW-593: Cron Monitor Alerts are not linked to monitor when created via the old flow
Original PR URL: getsentry#104004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants