Repository navigation
refactor(background_tasks): follow the module layout (moves only) - #859
Merged
Merged
Conversation
Constants, settings, worker engine settings, config guards, health, lifecycle, the invalidation transport, the sync session factory and tracking -> core/; the Celery app factory, runner, tenant task bases, routing, heartbeats, signals, worker settings and fleet inspection -> worker/; enqueue after commit, tenant context, the admin listing service, filters and retries -> executions/; the outbox_* files -> outbox/; retained logs -> logs/; deps and endpoints -> web/; page components and TS helpers -> ui/. tasks.py stays at the root and Celery task names are unchanged; no durable event or handler moved. Ten old paths (runner, celery_app, sync_db, tenant_context, settings, config_guards, task_routing, worker_settings, outbox_transport, outbox_worker) stay as deprecated sys.modules aliases (remove_in 0.0.46) because worker scripts and smpy_modules import them. Logger names that come from __name__ change with the move. One test-only change: a signals test now releases the tenant it claimed, so the new collection order no longer leaks the task owner into later tests. 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. |
Deploying simple-module-python with
|
| Latest commit: |
591b945
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cbeb26ed.simple-module-python.pages.dev |
| Branch Preview URL: | https://refactor-layout-background-t.simple-module-python.pages.dev |
This was referenced Nov 6, 2026
background_tasks: restore_tenant stores "" for the task owner, which leaks between signal tests
#861
Closed
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/background_taskstodocs/module-layout.md, same pattern as #852 (permissions).core/,worker/,executions/,outbox/,logs/(added toDOMAIN_AREAS), plusweb/andui/{components,utils};tasks.py,module.py,models.pystay at the roottest_background_tasks_*basenames; tests-js imports rewrittenrunner,celery_app,sync_db,tenant_context,settings,config_guards,task_routing,worker_settings,outbox_transport,outbox_worker) stay as deprecatedsys.modulesaliases (remove_in0.0.46) because existingrun_worker.pyscripts andsmpy_modulesimport themNo logic changes: Celery task names (before/after diff identical), queue names, permission names, i18n keys, settings keys, log event keys, logger-name literals and
app.stateattributes are unchanged; no durable event or handler moved (host/tests/test_durable_wire_names.pyuntouched).getLogger(__name__)loggers follow their module's new path (noted in the CHANGELOG).Note for #851: a trial merge carries its
views.py/Workers.tsxedits over cleanly and conflicts only on one import line intests-js/background_tasks_WorkersPage.test.tsx(WorkerSnapshotnow lives inui/utils/constants).Verification
make lint,make doctor,make ci-css-build,make ci-api-types-fresh,make ci-docs-buildpassPYTEST_WORKERS=8 make test-py(8162 passed,SM_TEST_REDIS_URLset),make test-js(898) pass on the move commit; the follow-up commit only fixes stale paths in docs and comments (ruff check/format clean, affected tests rerun)from background_tasks.runner import build_runner_celeryworks with a DeprecationWarning,import scripts.run_workerworks, moved files body-identical apart from imports; stale-path findings fixedhttps://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq