[Debt] Split large files router into focused route modules #25

Closed
opened 2026-07-11 11:39:43 +02:00 by zemion · 3 comments
Owner

govoplan-files has a very large backend router that mixes connector settings, browsing/import, upload/download, sharing, folders, deltas, transfers, and archive handling. This increases regression risk and makes focused review hard.

Hotspot: src/govoplan_files/backend/router.py is over 3,000 lines.

Acceptance: split routes by responsibility while preserving API paths, keep shared helpers in service/storage modules, and add smoke tests for route registration/key endpoints.

`govoplan-files` has a very large backend router that mixes connector settings, browsing/import, upload/download, sharing, folders, deltas, transfers, and archive handling. This increases regression risk and makes focused review hard. Hotspot: `src/govoplan_files/backend/router.py` is over 3,000 lines. Acceptance: split routes by responsibility while preserving API paths, keep shared helpers in service/storage modules, and add smoke tests for route registration/key endpoints. <!-- codex-audit-2026-07-11:files-router-split -->
Author
Owner

Codex State: progress

Summary

  • Added route-registration smoke coverage for connector and bulk organize endpoints so future router splits can preserve API paths.
  • Extracted connector settings delta response assembly helpers out of the route body, reducing the highest-risk connector route hotspot without moving paths yet.

Changed Files

  • src/govoplan_files/backend/router.py
  • tests/test_router_contract.py

Verification

  • same focused files test suite as above

Next / Blocked

  • The full router is still not physically split into focused route modules; keep this issue open for the actual route-module extraction.
## Codex State: progress ### Summary - Added route-registration smoke coverage for connector and bulk organize endpoints so future router splits can preserve API paths. - Extracted connector settings delta response assembly helpers out of the route body, reducing the highest-risk connector route hotspot without moving paths yet. ### Changed Files - `src/govoplan_files/backend/router.py` - `tests/test_router_contract.py` ### Verification - `same focused files test suite as above` ### Next / Blocked - The full router is still not physically split into focused route modules; keep this issue open for the actual route-module extraction.
zemion added the area/apicodex/readymodule/files
priority
p2
status
ready
type
debt
labels 2026-07-29 14:15:08 +02:00
Author
Owner

Codex State: reviewed

Reviewed against published Files 5b86827. This remains open: backend/router.py is still 3,567 lines and connector settings, browsing, upload/download, sharing, deltas, transfers, and archive behavior are not physically split into route modules.

## Codex State: reviewed Reviewed against published Files `5b86827`. This remains open: `backend/router.py` is still 3,567 lines and connector settings, browsing, upload/download, sharing, deltas, transfers, and archive behavior are not physically split into route modules.
Author
Owner

Codex State: complete

Implemented and published in 86a905a.

  • Replaced the 3,567-line catch-all router with focused space, folder, listing/delta, upload, connector settings, connector I/O, connector profile, asset, sharing, and transfer/archive route modules.
  • Moved common HTTP support, file-list/delta query assembly, and connector-settings delta assembly into focused support/service modules while retaining the existing storage layer.
  • Preserved all 41 baseline operations in the exact original order, with no missing, added, or duplicate method/path pairs.
  • Expanded the route contract regression test to verify complete composition.
  • Verified with Ruff and the full Files suite: 72 tests plus 19 subtests passed.
## Codex State: complete Implemented and published in `86a905a`. - Replaced the 3,567-line catch-all router with focused space, folder, listing/delta, upload, connector settings, connector I/O, connector profile, asset, sharing, and transfer/archive route modules. - Moved common HTTP support, file-list/delta query assembly, and connector-settings delta assembly into focused support/service modules while retaining the existing storage layer. - Preserved all 41 baseline operations in the exact original order, with no missing, added, or duplicate method/path pairs. - Expanded the route contract regression test to verify complete composition. - Verified with Ruff and the full Files suite: 72 tests plus 19 subtests passed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-files#25