Skip to content

refactor(users): follow the module layout (moves only) - #862

Merged
antosubash merged 2 commits into
mainfrom
refactor/layout-users
Nov 6, 2026
Merged

antosubash merged 2 commits into
mainfrom
refactor/layout-users

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Moves-only restructure of modules/users to docs/module-layout.md, the last module. With this, LEGACY_FLAT in host/tests/test_module_layout.py is empty: every module follows the layout.

  • core/ (beside password_hashing): constants, settings, state, bootstrap, setup and startup files
  • accounts/ (new domain area in DOMAIN_AREAS): fastapi-users backend, DB adapter, manager, registration, provider, tokens, revocation
  • web/: deps, shared props
  • ui/utils/: failureMessage, signIn; page and tests-js imports rewritten
  • admin/, auth_local/, demo/, invites/, mailer/, oauth/ stay as declared domain areas
  • Tests mirror the areas; shared admin helpers live in tests/_users_admin_support.py
  • users.{constants,settings,state,bootstrap,deps} stay as deprecated sys.modules aliases, and users.middleware becomes the same kind of alias of auth.web.middleware (it was a plain re-export before), all remove_in 0.0.46

No logic changes: permission names, i18n/audit label keys, the setup key users.setup.administrator, string logger names, invalidation channels, app.state attributes, durable wire names and migrations are untouched. logging.getLogger(__name__) loggers in moved files get new names (e.g. users.accounts.manager); nothing references the old ones.

Verification

  • PYTEST_WORKERS=8 make test-py: 8162 passed (on this commit, rebased onto refactor(background_tasks): follow the module layout (moves only) #859); make lint exit 0; host.main imports with -W error::DeprecationWarning
  • Before the rebase: make test-js (898), make doctor, make ci-css-build, make ci-api-types-fresh, make ci-docs-build all exit 0; the wheel holds all 153 source files
  • Two independent reviews (correctness, maintainability): 0 blocking findings. Alias identity confirmed for all six shims, uv run smpy users --help works, host/tests/test_durable_wire_names.py unchanged vs main, no host/migrations file changed
  • No browser smoke (moves-only, skipped)

Note for #851: that PR edits modules/users/tests/test_users_admin_list_query_count.py (now tests/admin/queries/) and docs/frontend/performance.md, which this PR also edits; expect a rebase on one side.

Pre-existing test-isolation fragility found while moving: test_users_password_offload monkeypatches an attribute on the shared PasswordHelper instance, which can shadow class-level patches in later lockout tests depending on collection order. The move places that test so the suite is green; a proper fix is a follow-up.

https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq

Constants, settings, state, errors, administrators, bootstrap, startup, data
compatibility, the directory, audit naming, the roles cache and the setup
step -> core/ (beside password_hashing); the fastapi-users backend and DB
adapter, user manager, registration hooks, auth provider, token storage and
strategy and credential/reset/session revocation -> accounts/ (domain area);
deps and shared props -> web/; the failureMessage/signIn TS helpers ->
ui/utils/. admin/, auth_local/, demo/, invites/, mailer/ and oauth/ stay as
declared domain areas. Tests mirror the areas; shared admin test helpers move
to tests/_users_admin_support.py.

users.{constants,settings,state,bootstrap,deps} stay as deprecated sys.modules
aliases (remove_in 0.0.46), and users.middleware becomes the same kind of
alias of auth.web.middleware. Durable names, permission names, i18n/audit
keys, the setup key and string logger names are unchanged.

Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 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-11-06T03:41:27.623510Z 06a0904 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.

docs named users.directory.UsersDirectory as the installed directory class.

Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 61d5f16
Status: ✅  Deploy successful!
Preview URL: https://8e998899.simple-module-python.pages.dev
Branch Preview URL: https://refactor-layout-users.simple-module-python.pages.dev

View logs

@antosubash
antosubash merged commit 0e68af1 into main Nov 6, 2026
17 checks passed
@antosubash
antosubash deleted the refactor/layout-users branch November 6, 2026 03:51
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