Commit ef00538
committed
feat(cron-monitors): Add billing seat management to cron monitor detectors
Implements billing seat management for cron monitor detectors via the
MonitorIncidentDetectorValidator. This ensures that cron monitors
created through the detector API properly handle seat assignment,
validation, and removal.
Changes:
- Add validate_enabled() to check seat availability before enabling
- Modify create() to assign seats with graceful degradation when no
seats are available (detector created but disabled)
- Modify update() to handle enable/disable transitions with seat
operations and race condition handling
- Add delete() to remove seats immediately when detector is deleted
- Add comprehensive test coverage for all seat management scenarios
Uses generic seat APIs (assign_seat, check_assign_seat, disable_seat,
remove_seat) with DataCategory.MONITOR following the same pattern as
uptime monitors.
Fixes [NEW-619: Ensure CRUD / enable+disable Cron Detectors in new UI handles assigning / unassigning seats](https://linear.app/getsentry/issue/NEW-619/ensure-crud-enabledisable-cron-detectors-in-new-ui-handles-assigning)1 parent e7a917f commit ef00538
File tree
3 files changed
+282
-27
lines changed- src/sentry/monitors
- tests/sentry/monitors
3 files changed
+282
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
812 | 813 | | |
813 | 814 | | |
814 | 815 | | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
815 | 825 | | |
816 | 826 | | |
817 | 827 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
380 | 383 | | |
381 | 384 | | |
382 | 385 | | |
| |||
636 | 639 | | |
637 | 640 | | |
638 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
639 | 645 | | |
640 | 646 | | |
641 | | - | |
| 647 | + | |
642 | 648 | | |
643 | 649 | | |
644 | 650 | | |
| |||
686 | 692 | | |
687 | 693 | | |
688 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
689 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
690 | 741 | | |
691 | 742 | | |
692 | 743 | | |
693 | 744 | | |
694 | 745 | | |
695 | 746 | | |
696 | 747 | | |
697 | | - | |
698 | | - | |
| 748 | + | |
699 | 749 | | |
700 | 750 | | |
701 | 751 | | |
| |||
709 | 759 | | |
710 | 760 | | |
711 | 761 | | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
0 commit comments