Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
]
Expand Down Expand Up @@ -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,
},
]
Expand Down
Loading