Repository navigation
Tech-debt batch 13: apply role grants, module settings and flag overrides after commit, across workers (#621) - #646
Merged
Merged
Conversation
…ommit, across workers (#621) Changes now apply from db.on_commit and propagate through the InvalidationBus; every worker re-hydrates from the DB, with a 30 s periodic reload as the staleness floor. Branding builds responses from the validated settings and reads the previous asset ids from the DB. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…worker
An autouse SM_PROJECT_ROOT=tmp_path fixture made the lru_cached lookup return ()
once, so every later app fixture in that xdist worker skipped stamping and the
lifespan refused to boot ('36 revision(s) behind'). Order-dependent on main too.
Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…ve-check sleep Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
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. |
Deploying simple-module-python with
|
| Latest commit: |
befc1ee
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e5d4a148.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-debt-batch-13.simple-module-python.pages.dev |
# Conflicts: # CHANGELOG.md
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.
Tech-debt batch 13 — admin changes now reach every worker, and only after commit (#621).
Role→permission edits (
permissions), module settings saves (settings/reload.py) and feature-flag overrides used to mutate the handling worker's in-memory state inside the request, before commit, and never told other workers: with N workers, revoking a permission, enabling site_lock or flipping a kill switch affected one worker until restart, and a rolled-back request left that worker enforcing state the DB didn't have.db.on_commitand published on theInvalidationBus; every worker re-hydrates from the DB (modules/{settings,permissions,feature_flags}/…/invalidation.py).simple_module_core.invalidation_refresh.InvalidationRefresh: serialized reloads + a 30 s periodic reload as the staleness floor when messages are missed (in-process bus or Redis outage). Per-package isolation, no-op on identical snapshots, quiet on an unmigrated DB.SettingsReloadednow fires on re-hydration (after commit), only when values changed.appfixture's alembic-heads lookup waslru_cached; an autouseSM_PROJECT_ROOT=tmp_pathfixture could cache()for the whole xdist worker, after which every app in that worker refused to boot ("36 revision(s) behind"). Order-dependent on main too (reproduced withtest_cli_import.py+test_env_pinned.py).Verification
main, pass here.make lint✓ ·make test-py(8 workers) ✓ 6038 passed ·make test-js✓ 770 · Postgres (settings, feature_flags, permissions, branding, core, testing) ✓ 1343 passed.Closes #621
https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4