From 8f0ecc6b7f9c87debbc188742972405493ebf34f Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Tue, 17 Jan 2023 12:40:15 +0100 Subject: [PATCH] Revert check for new legacy routes --- lib/galaxy/webapps/galaxy/fast_app.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/fast_app.py b/lib/galaxy/webapps/galaxy/fast_app.py index 609b8b645a4..abe012ba5d6 100644 --- a/lib/galaxy/webapps/galaxy/fast_app.py +++ b/lib/galaxy/webapps/galaxy/fast_app.py @@ -141,29 +141,12 @@ def include_legacy_openapi(app, gx_app): tags=api_tags_metadata, ) legacy_openapi = gx_app.api_spec.to_dict() - _check_legacy_openapi_does_not_increase(legacy_openapi) legacy_openapi["paths"].update(openapi_schema["paths"]) openapi_schema["paths"] = legacy_openapi["paths"] app.openapi_schema = openapi_schema return app.openapi_schema -def _check_legacy_openapi_does_not_increase(legacy_openapi): - """This will check that we don't keep adding legacy API routes to the codebase. - - After migrating any legacy route to FastAPI, remember to update `expected_legacy_paths` with the current number - until all routes are migrated, then, completely remove this check function. - """ - expected_legacy_paths = 169 - num_actual_legacy_paths = len(legacy_openapi["paths"]) - assert ( - num_actual_legacy_paths <= expected_legacy_paths - ), "The number of legacy API routes has increased. Please convert these API routes to FastAPI." - assert ( - num_actual_legacy_paths == expected_legacy_paths - ), "Did you forget to update `expected_legacy_paths` after migrating legacy API routes?" - - def get_fastapi_instance() -> FastAPI: return FastAPI( title="Galaxy API",