Skip to content

Split near-cap Python files by responsibility (#522, Python half) - #578

Merged
antosubash merged 16 commits into
mainfrom
chore/file-splits-522
Oct 22, 2026
Merged

antosubash merged 16 commits into
mainfrom
chore/file-splits-522

Conversation

@antosubash

Copy link
Copy Markdown
Owner

This PR splits the 14 Python files that sat at or near the 300-line cap, along lines of responsibility, before the next feature forces a rushed split (#522). Behaviour does not change.

Splits

Modules

  • tenants: service.py 300 → 184 lines. Membership operations move to _membership_ops.py.
  • permissions: service.py 296 → 214 lines. Registry sync and effective-permission resolution move to _registry_sync.py; role and user CRUD stay.
  • file_storage: service.py 299 → 210 lines (deletes move to deletes.py). module.py 290 → 236 lines (audit_labels.py, body_limits.py).
  • background_tasks: settings.py 300 → 143 lines. Celery, worker and retention fields move to settings_celery.py. Field order is unchanged.

Framework

  • db: migrations.py 300 → 235 lines (_migration_render.py). bulk_audit.py 291 → 193 lines (_bulk_audit_records.py).
  • core: permissions.py 300 → 241 lines (_permission_grants.py). i18n.py 292 → 198 lines (_i18n_translator.py).
  • cli: app_project.py 300 → 219 lines (_app_project_manifests.py). add_cmd.py 298 → 184 lines (_add_install.py, _add_sources.py).
  • hosting: host_settings.py 297 → 245 lines (_host_settings_support.py). app_builder.py 297 → 247 lines (_app_boot.py). _phase_helpers.py 297 → 110 lines (_middleware_pipeline.py).

What does not change

  • Every public name is still importable from its original module, which re-exports it. Logger names are kept.
  • Names that tests monkeypatch stay in their original module, so the patches still take effect. No test assertion was touched.
  • No CHANGELOG entry, because nothing user-visible changes.

Still open in #522

The frontend splits (file_storage/pages/Browse.tsx → useFileActions, users/pages/Users/AddPeople.tsx, packages/ui SidebarLayout.tsx) and the shared useAction/DataTable pieces. They land with the next typed-client batch, which rewrites those pages anyway.

Verification

  • make lint ✓
  • make test-py: 5566 passed ✓
  • Code review by Claude and Codex: both clean.
  • No browser QA: these are internal moves with no UI change.

Part of #522

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3074280
Status: ✅  Deploy successful!
Preview URL: https://cd466015.simple-module-python.pages.dev
Branch Preview URL: https://chore-file-splits-522.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-22T11:29:29.353132Z 3074280 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash
antosubash merged commit 2acba0c into main Oct 22, 2026
17 checks passed
@antosubash
antosubash deleted the chore/file-splits-522 branch October 22, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant