Repository navigation
feat(background_tasks): tracking modes and resource-visible task status (#710, #709) - #718
Merged
Merged
Conversation
Admin retries are always fully tracked (a reduced mode left the reserved pending row stuck); lazy celery import; publish path no longer inherits a running task's mode; docs: no TaskFailed in off mode. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…ared length constant, docs) Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Deploying simple-module-python with
|
| Latest commit: |
be29a70
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://32c2e081.simple-module-python.pages.dev |
| Branch Preview URL: | https://feat-b31-bg-tracking-resourc.simple-module-python.pages.dev |
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. |
7 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.
Two background_tasks requests from the gis-data-portal port: tracking can be turned down or off per task, and collaborators on a resource can watch a task's status.
Closes #710
Closes #709
What changed
TrackingMode:full(today),terminal(success, failure and revoked only),failures(final failure and revoked only) andoff..set(headers={SM_TRACKING_HEADER: …})), then the task option@shared_task(sm_tracking=…), then the DB settingexecution_tracking, which defaults tofull.heartbeat()honours the mode before opening a session.finally.track_publish(DB setting, defaulttrue).falseremoves the publisher-side DB write, and the worker creates the row from the message (owner, tenant, queue, args, resource). Until a worker picks the task up, its status is a 404.pendingrow up front, and a reduced mode would never move it on. Review found this.with_task_resource(sig, resource_type=…, resource_id=…)tags a task, and admin retries keep the tag.ResourceTypepolicy letsviewit, checked withload_authorized.b31a70971001onbackground_tasks@headadds nullableresource_typeandresource_idcolumns with a both-or-neither check constraint.test_migration_graphis updated for the new head.TaskFailedis not published for a task inoffmode, since there is no row for it to point at; the docs say so.Verification
make lint✓ ·make test-js✓ ·make test-py✓ (6550 passed, 41 skipped) ·make migrations-roundtrip-pg✓ (alembic check: no new operations)test_background_tasks_tracking_modes.py); collaborator allowed, revoked share denied, cross-tenant and no-tenant denied, missing resource, DTO secrecy (test_background_tasks_resource_status.py); headers across worker-only tracking and admin retry (test_background_tasks_resource_transport.py); migration roundtrip and constraint (test_background_tasks_resource_migration.py).https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4