Skip to content

Commit 4831baf

Browse files
committed
Deprecating old /v1/run* endpoints
1 parent c41e9c3 commit 4831baf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

api/api_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def get_phase_stats_object(phase_stats, case=None, comparison_details=None, comp
647647
'values': [value],
648648
}
649649
if comparison_details: # create None filled lists in comparison casese so that we can later understand which values are missing when parsing in JS for example
650-
detail_data[key]['values'] = [None for _ in comparison_details[key]]
650+
detail_data[key]['values'] = [None for _ in comparison_details[key]] # Debug: if this line errors it means we have not inserted a new at the beginning of the function (L584++)
651651
detail_data[key]['sr_avg_values'] = [None for _ in comparison_details[key]]
652652
detail_data[key]['sr_max_values'] = [None for _ in comparison_details[key]]
653653
detail_data[key]['sr_95p_values'] = [None for _ in comparison_details[key]]

api/scenario_runner.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ async def get_repositories(uri: str | None = None, branch: str | None = None, ma
188188
return ORJSONResponse({'success': True, 'data': escaped_data})
189189

190190

191+
@router.get('/v1/runs', deprecated=True)
192+
def old_v1_runs_endpoint():
193+
return ORJSONResponse({'success': False, 'err': 'This endpoint is deprecated. Please migrate to /v2/runs'}, status_code=410)
194+
191195
# A route to return all of the available entries in our catalog.
192196
@router.get('/v2/runs')
193197
async def get_runs(uri: str | None = None, branch: str | None = None, machine_id: int | None = None, machine: str | None = None, filename: str | None = None, limit: int | None = 50, uri_mode = 'none', user: User = Depends(authenticate)):
@@ -674,6 +678,9 @@ async def software_add(software: Software, user: User = Depends(authenticate)):
674678

675679
return ORJSONResponse({'success': True, 'data': job_ids_inserted}, status_code=202)
676680

681+
@router.get('/v1/run/{run_id}', deprecated=True)
682+
def old_v1_run_endpoint():
683+
return ORJSONResponse({'success': False, 'err': 'This endpoint is deprecated. Please migrate to /v1/run/{run_id}'}, status_code=410)
677684

678685
@router.get('/v2/run/{run_id}')
679686
async def get_run(run_id: str, user: User = Depends(authenticate)):

0 commit comments

Comments
 (0)