Skip to content

feat: add PluggableContextTask for settings-based celery task context managers#14572

Open
valentijnscholten wants to merge 1 commit intoDefectDojo:bugfixfrom
valentijnscholten:pluggable-task-context
Open

feat: add PluggableContextTask for settings-based celery task context managers#14572
valentijnscholten wants to merge 1 commit intoDefectDojo:bugfixfrom
valentijnscholten:pluggable-task-context

Conversation

@valentijnscholten
Copy link
Member

@valentijnscholten valentijnscholten commented Mar 22, 2026

Summary

This is needed for Pro.

  • Add PluggableContextTask between DojoAsyncTask and PgHistoryTask that loads context managers from the CELERY_TASK_CONTEXT_MANAGERS setting, allowing plugins to wrap all celery tasks without relying on celery signals (which don't fire in prefork workers)
  • Re-parent PgHistoryTask to extend PluggableContextTask — no downstream changes needed
  • Propagate sync kwarg from process_findings to dojo_dispatch_task in both DefaultImporter and DefaultReImporter so callers can force post_process_findings_batch to run in-process

… managers

Add PluggableContextTask between DojoAsyncTask and PgHistoryTask that loads
context managers from the CELERY_TASK_CONTEXT_MANAGERS setting. This allows
plugins (e.g. Pro) to wrap all celery tasks with custom context managers
without relying on celery signals (which don't fire in prefork workers).

Also propagate sync kwarg from process_findings to dojo_dispatch_task in
both DefaultImporter and DefaultReImporter so callers can force
post_process_findings_batch to run in-process.
@valentijnscholten valentijnscholten added the affects_pro PRs that affect Pro and need a coordinated release/merge moment. label Mar 22, 2026
@valentijnscholten valentijnscholten added this to the 2.56.4 milestone Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects_pro PRs that affect Pro and need a coordinated release/merge moment.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant