diff --git a/src/sentry/tasks/post_process.py b/src/sentry/tasks/post_process.py index 681962bd83ce..a329a4216ca1 100644 --- a/src/sentry/tasks/post_process.py +++ b/src/sentry/tasks/post_process.py @@ -1569,9 +1569,6 @@ def kick_off_seer_automation(job: PostProcessJob) -> None: return if is_seer_seat_based_tier_enabled(group.organization): - # Guards to prevent thundering herd on issue summary generation. - if options.get("seer.post-process-issue-summary-killswitch.enabled"): - return if group.seer_fixability_score is not None: return # Issues created in last 5 minutes only. This can be removed once this is live past 1 week. @@ -1643,6 +1640,7 @@ def process_siem_security_logging(job: PostProcessJob) -> None: process_commits, handle_owner_assignment, handle_auto_assignment, + kick_off_seer_automation, kick_off_lightweight_rca_cluster, process_workflow_engine, process_resource_change_bounds, @@ -1671,6 +1669,7 @@ def process_siem_security_logging(job: PostProcessJob) -> None: GENERIC_POST_PROCESS_PIPELINE: list[Callable[[PostProcessJob], None]] = [ process_snoozes, process_inbox_adds, + kick_off_seer_automation, process_workflow_engine, process_resource_change_bounds, process_data_forwarding, diff --git a/tests/sentry/tasks/test_post_process.py b/tests/sentry/tasks/test_post_process.py index e0803c1253b2..e87599e6193f 100644 --- a/tests/sentry/tasks/test_post_process.py +++ b/tests/sentry/tasks/test_post_process.py @@ -2935,9 +2935,9 @@ def test_step_is_skipped_by_fully_specified_condition( class KickOffSeerAutomationTestMixin(BasePostProcessGroupMixin): - @pytest.mark.xfail(reason="Seer automation was removed from the post-process pipeline") @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") @with_feature("organizations:gen-ai-features") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_kick_off_seer_automation_with_features(self, mock_generate_summary_and_run_automation): self.project.update_option("sentry:seer_scanner_automation", True) event = self.create_event( @@ -2957,6 +2957,7 @@ def test_kick_off_seer_automation_with_features(self, mock_generate_summary_and_ ) @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_kick_off_seer_automation_without_org_feature( self, mock_generate_summary_and_run_automation ): @@ -2976,6 +2977,7 @@ def test_kick_off_seer_automation_without_org_feature( @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") @with_feature("organizations:gen-ai-features") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_kick_off_seer_automation_without_scanner_on( self, mock_generate_summary_and_run_automation ): @@ -2997,6 +2999,7 @@ def test_kick_off_seer_automation_without_scanner_on( @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") @with_feature("organizations:gen-ai-features") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_kick_off_seer_automation_skips_existing_fixability_score( self, mock_generate_summary_and_run_automation ): @@ -3020,9 +3023,9 @@ def test_kick_off_seer_automation_skips_existing_fixability_score( mock_generate_summary_and_run_automation.assert_not_called() - @pytest.mark.xfail(reason="Seer automation was removed from the post-process pipeline") @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") @with_feature("organizations:gen-ai-features") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_kick_off_seer_automation_runs_with_missing_fixability_score( self, mock_generate_summary_and_run_automation ): @@ -3049,6 +3052,7 @@ def test_kick_off_seer_automation_runs_with_missing_fixability_score( @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") @with_feature("organizations:gen-ai-features") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_kick_off_seer_automation_skips_with_existing_fixability_score( self, mock_generate_summary_and_run_automation ): @@ -3078,11 +3082,11 @@ def test_kick_off_seer_automation_skips_with_existing_fixability_score( mock_generate_summary_and_run_automation.assert_not_called() - @pytest.mark.xfail(reason="Seer automation was removed from the post-process pipeline") @patch("sentry.seer.autofix.utils.is_seer_scanner_rate_limited") @patch("sentry.quotas.backend.check_seer_quota") @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") @with_feature("organizations:gen-ai-features") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_rate_limit_only_checked_after_all_other_checks_pass( self, mock_generate_summary_and_run_automation, @@ -3152,9 +3156,9 @@ def test_rate_limit_only_checked_after_all_other_checks_pass( mock_is_rate_limited.assert_not_called() mock_generate_summary_and_run_automation.assert_not_called() - @pytest.mark.xfail(reason="Seer automation was removed from the post-process pipeline") @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") @with_feature("organizations:gen-ai-features") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_kick_off_seer_automation_skips_when_lock_held( self, mock_generate_summary_and_run_automation ): @@ -3204,6 +3208,7 @@ def test_kick_off_seer_automation_skips_when_lock_held( @patch("sentry.tasks.seer.autofix.generate_summary_and_run_automation.delay") @with_feature("organizations:gen-ai-features") + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_kick_off_seer_automation_with_hide_ai_features_enabled( self, mock_generate_summary_and_run_automation ): @@ -3290,15 +3295,6 @@ def _seat_based_post_process(self, **group_overrides): ) return event - @patch("sentry.tasks.seer.autofix.generate_issue_summary_only.delay") - @with_feature({"organizations:gen-ai-features": True}) - @override_options({"seer.post-process-issue-summary-killswitch.enabled": True}) - def test_seat_based_org_killswitch_prevents_summary( - self, mock_generate_summary_only, mock_seat_based_tier - ): - self._seat_based_post_process() - mock_generate_summary_only.assert_not_called() - @patch("sentry.tasks.seer.autofix.generate_issue_summary_only.delay") @with_feature({"organizations:gen-ai-features": True}) @override_options({"seer.post-process-issue-summary.rollout-rate": 0.0}) @@ -3313,6 +3309,7 @@ def test_seat_based_org_rollout_skips_tier_check( @patch("sentry.tasks.seer.autofix.generate_issue_summary_only.delay") @with_feature({"organizations:gen-ai-features": True}) + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_seat_based_org_skips_old_issues( self, mock_generate_summary_only, mock_seat_based_tier ): @@ -3321,6 +3318,7 @@ def test_seat_based_org_skips_old_issues( @patch("sentry.tasks.seer.autofix.generate_issue_summary_only.delay") @with_feature({"organizations:gen-ai-features": True}) + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_seat_based_org_skips_when_fixability_exists( self, mock_generate_summary_only, mock_seat_based_tier ): @@ -3409,10 +3407,10 @@ class PostProcessGroupErrorTest( PipelineKillswitchTestMixin, CheckIfFlagsSentTestMixin, ): - @pytest.mark.xfail(reason="Seer automation was removed from the post-process pipeline") @patch("sentry.seer.autofix.utils.is_seer_seat_based_tier_enabled", return_value=True) @patch("sentry.tasks.seer.autofix.generate_issue_summary_only.delay") @with_feature({"organizations:gen-ai-features": True}) + @override_options({"seer.post-process-issue-summary.rollout-rate": 1.0}) def test_seat_based_org_generates_summary_for_new_issues( self, mock_generate_summary_only, mock_seat_based_tier ):