diff --git a/src/sentry/seer/endpoints/organization_autofix_automation_settings.py b/src/sentry/seer/endpoints/organization_autofix_automation_settings.py index b6bab8d2f396..13f57535a11b 100644 --- a/src/sentry/seer/endpoints/organization_autofix_automation_settings.py +++ b/src/sentry/seer/endpoints/organization_autofix_automation_settings.py @@ -171,17 +171,15 @@ def _serialize_projects_with_settings( or AutofixAutomationTuningSettings.OFF.value ) seer_pref = seer_preferences_map.get(str(project.id)) or {} - automated_run_stopping_point = seer_pref.get( - "automated_run_stopping_point", AutofixStoppingPoint.CODE_CHANGES.value - ) - repos_count = len(seer_pref.get("repositories") or []) - results.append( { "projectId": project.id, - "autofixAutomationTuning": autofix_automation_tuning, - "automatedRunStoppingPoint": automated_run_stopping_point, - "reposCount": repos_count, + "autofixAutomationTuning": autofix_automation_tuning, # project options + "automatedRunStoppingPoint": seer_pref.get( + "automated_run_stopping_point", AutofixStoppingPoint.CODE_CHANGES.value + ), + "automationHandoff": seer_pref.get("automation_handoff"), + "reposCount": len(seer_pref.get("repositories") or []), } ) return results diff --git a/tests/sentry/seer/endpoints/test_organization_autofix_automation_settings.py b/tests/sentry/seer/endpoints/test_organization_autofix_automation_settings.py index 1765bd54fd08..c1d408915830 100644 --- a/tests/sentry/seer/endpoints/test_organization_autofix_automation_settings.py +++ b/tests/sentry/seer/endpoints/test_organization_autofix_automation_settings.py @@ -37,12 +37,14 @@ def test_get_returns_default_settings_for_all_projects(self, mock_bulk_get_prefe "projectId": project1.id, "autofixAutomationTuning": AutofixAutomationTuningSettings.OFF.value, "automatedRunStoppingPoint": AutofixStoppingPoint.CODE_CHANGES.value, + "automationHandoff": None, "reposCount": 0, }, { "projectId": project2.id, "autofixAutomationTuning": AutofixAutomationTuningSettings.OFF.value, "automatedRunStoppingPoint": AutofixStoppingPoint.CODE_CHANGES.value, + "automationHandoff": None, "reposCount": 0, }, ] @@ -129,12 +131,14 @@ def test_get_reads_project_preferences(self, mock_bulk_get_preferences): "projectId": project1.id, "autofixAutomationTuning": AutofixAutomationTuningSettings.MEDIUM.value, "automatedRunStoppingPoint": AutofixStoppingPoint.OPEN_PR.value, + "automationHandoff": None, "reposCount": 1, }, { "projectId": project2.id, "autofixAutomationTuning": AutofixAutomationTuningSettings.HIGH.value, "automatedRunStoppingPoint": AutofixStoppingPoint.OPEN_PR.value, + "automationHandoff": None, "reposCount": 0, }, ]