feat(users): retire legacy users_user.tenant_id (#381) [stack 5/11] - #389
Merged
Merged
Conversation
UserContext.from_user no longer copies a tenant from the user row, UserRead drops tenant_id, and an Alembic migration drops the column and its index. Adds a regression test that membership add/remove/role change/switch apply on the next request without re-login. Claude-Session: https://claude.ai/code/session_01F8RiTBUJQnZmSq56qReZeV
Deploying simple-module-python with
|
| Latest commit: |
a6b0a7e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6bb5606e.simple-module-python.pages.dev |
| Branch Preview URL: | https://tenancy-05-users.simple-module-python.pages.dev |
…s (review of #381) Cookies signed before the users_user.tenant_id column was retired still carry it inside user_ctx, and the cached path returned it verbatim. The users provider now drops it there; the active tenant comes from memberships only. Claude-Session: https://claude.ai/code/session_01F8RiTBUJQnZmSq56qReZeV
antosubash
added this pull request to stack #397
October 1, 2026 16:14
antosubash
marked this pull request as ready for review
October 1, 2026 16:16
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. |
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.
Closes #381 (which replaces #360 and #362). Stack 5/11 of the tenancy-adoption series (base: #388).
What
Since #370,
tenants_membershipand the per-request resolver are the only source of a user's tenant. This PR retires the legacy column:UserContext.from_userno longer copiesusers_user.tenant_id. The claim path for generic providers is unchanged.tenant_idis removed fromUserandUserRead.d4e8a1b6c392on the users chain drops the column and its index. The downgrade re-adds both, nullable. Upgrade, downgrade and re-upgrade were verified on SQLite.Useris platform-global by design (documented inmulti-tenancy.md).#362 regression test
modules/tenants/tests/test_membership_changes.pykeeps one session cookie unchanged while the membership changes underneath it:No re-login is needed in any case.
Tests
make test-py: 3364 passed.make lintandmake doctorare clean.https://claude.ai/code/session_01F8RiTBUJQnZmSq56qReZeV