Repository navigation
refactor(users): follow the module layout (moves only) - #862
Merged
Merged
Conversation
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
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
Deploying simple-module-python with
|
| 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 |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves-only restructure of
modules/userstodocs/module-layout.md, the last module. With this,LEGACY_FLATinhost/tests/test_module_layout.pyis empty: every module follows the layout.core/(besidepassword_hashing):constants,settings,state,bootstrap, setup and startup filesaccounts/(new domain area inDOMAIN_AREAS): fastapi-users backend, DB adapter, manager, registration, provider, tokens, revocationweb/:deps, shared propsui/utils/:failureMessage,signIn; page and tests-js imports rewrittenadmin/,auth_local/,demo/,invites/,mailer/,oauth/stay as declared domain areastests/_users_admin_support.pyusers.{constants,settings,state,bootstrap,deps}stay as deprecatedsys.modulesaliases, andusers.middlewarebecomes the same kind of alias ofauth.web.middleware(it was a plain re-export before), allremove_in0.0.46No logic changes: permission names, i18n/audit label keys, the setup key
users.setup.administrator, string logger names, invalidation channels,app.stateattributes, 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 lintexit 0;host.mainimports with-W error::DeprecationWarningmake test-js(898),make doctor,make ci-css-build,make ci-api-types-fresh,make ci-docs-buildall exit 0; the wheel holds all 153 source filesuv run smpy users --helpworks,host/tests/test_durable_wire_names.pyunchanged vs main, nohost/migrationsfile changedNote for #851: that PR edits
modules/users/tests/test_users_admin_list_query_count.py(nowtests/admin/queries/) anddocs/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_offloadmonkeypatches an attribute on the sharedPasswordHelperinstance, 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