[Debt] Refactor high-complexity files connector and transfer flows #28

Closed
opened 2026-07-11 12:51:19 +02:00 by zemion · 1 comment
Owner

Xenon/Radon identify several D/F-ranked files functions, especially connector settings and transfer selection/rename flows.

Classification: structural maintainability work.

Report evidence:

  • connector_settings_delta rank F.
  • record_campaign_attachment_uses_for_jobs rank F.
  • transfer_selection rank F.
  • _rename_selection rank F.
  • _profile_from_mapping rank E.

Suggested next steps:

  • Split router response building from connector policy/business logic.
  • Extract transfer selection and rename planning into tested pure helpers.
  • Keep connector API behavior unchanged while reducing complexity.

Baseline report directory: audit-reports/govoplan-full-20260711-1238

<!-- codex-audit-full-2026-07-11:files-complexity-baseline --> Xenon/Radon identify several D/F-ranked files functions, especially connector settings and transfer selection/rename flows. Classification: **structural maintainability work**. Report evidence: - `connector_settings_delta` rank F. - `record_campaign_attachment_uses_for_jobs` rank F. - `transfer_selection` rank F. - `_rename_selection` rank F. - `_profile_from_mapping` rank E. Suggested next steps: - Split router response building from connector policy/business logic. - Extract transfer selection and rename planning into tested pure helpers. - Keep connector API behavior unchanged while reducing complexity. Baseline report directory: `audit-reports/govoplan-full-20260711-1238`
zemion added the
type
debt
priority
p3
status
ready
module/files
codex/ready
labels 2026-07-11 12:51:19 +02:00
zemion added the
audit/complexity
audit/structural
source/security-audit
labels 2026-07-11 16:08:49 +02:00
Author
Owner

Codex State: done

Summary

  • Refactored connector settings delta response building into focused helpers.
  • Split connector profile mapping into provider/scope/credential/normalized-construction helpers.
  • Extracted transfer and rename request normalization/validation into tested pure helpers.

Changed Files

  • src/govoplan_files/backend/router.py
  • src/govoplan_files/backend/storage/connector_profiles.py
  • src/govoplan_files/backend/storage/transfers.py
  • tests/test_connector_providers.py
  • tests/test_transfer_helpers.py
  • tests/test_router_contract.py

Verification

  • PYTHONPATH=/mnt/DATA/git/govoplan-core/src:/mnt/DATA/git/govoplan-files/src /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_connector_providers tests.test_transfer_helpers tests.test_router_contract tests.test_access_provider
  • PYTHONPATH=/mnt/DATA/git/govoplan-core/src:/mnt/DATA/git/govoplan-files/src /mnt/DATA/git/govoplan/.venv/bin/python -m compileall -q src/govoplan_files tests dev/connectors/smoke.py
  • git diff --check
## Codex State: done ### Summary - Refactored connector settings delta response building into focused helpers. - Split connector profile mapping into provider/scope/credential/normalized-construction helpers. - Extracted transfer and rename request normalization/validation into tested pure helpers. ### Changed Files - `src/govoplan_files/backend/router.py` - `src/govoplan_files/backend/storage/connector_profiles.py` - `src/govoplan_files/backend/storage/transfers.py` - `tests/test_connector_providers.py` - `tests/test_transfer_helpers.py` - `tests/test_router_contract.py` ### Verification - `PYTHONPATH=/mnt/DATA/git/govoplan-core/src:/mnt/DATA/git/govoplan-files/src /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_connector_providers tests.test_transfer_helpers tests.test_router_contract tests.test_access_provider` - `PYTHONPATH=/mnt/DATA/git/govoplan-core/src:/mnt/DATA/git/govoplan-files/src /mnt/DATA/git/govoplan/.venv/bin/python -m compileall -q src/govoplan_files tests dev/connectors/smoke.py` - `git diff --check`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: add-ideas/govoplan-files#28
No description provided.