Skip to content

packages/django-postgres-dramatiq: add support for task dependencies - #23064

Merged
rissson merged 9 commits into
mainfrom
tasks-dependencies
Jun 18, 2026
Merged

rissson merged 9 commits into
mainfrom
tasks-dependencies

Conversation

@rissson

@rissson rissson commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

Details

What does this PR change?

Introduce a dependencies field on tasks, and a new task state waiting_for_dependencies, so that tasks may depend on other tasks finishing before running.

When enqueuing a task, a new option called dependencies has been added, which can be set to a list of tasks (or pks, or whatever django accepts). If that list is not empty, the task state is set to waiting_for_dependencies instead of queued.

When a task is done, it now looks for dependent tasks, and for each dependent task, checks if all its dependencies are done. If so, the dependent is marked as queued. When rejecting a task, all its dependents are marked as rejected.

Also, when the broker is grabbing new tasks, there is a new subroutine that runs when no tasks are found (to avoid blocking the broker when there is work to do) to find waiting_for_dependencies tasks that might have been missed when (n)ack-ing a task. The same logic as above applies here.

Why is this change needed?

To get rid of top-level tasks for synchronization processes, and to all for new processes for tracking the status of syncs. See #23126 for an example use case.

How was this tested?

With #23126

Linked issues


Checklist

  • The project has been linted, built, and tested (make all)
  • The documentation has been updated and formatted (make docs)

@netlify

netlify Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit a94c619
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a33c9950f6cda000857c320
😎 Deploy Preview https://deploy-preview-23064--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.27%. Comparing base (5a5ceda) to head (a94c619).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #23064   +/-   ##
=======================================
  Coverage   93.26%   93.27%           
=======================================
  Files        1035     1035           
  Lines       60314    60324   +10     
  Branches      400      400           
=======================================
+ Hits        56254    56265   +11     
+ Misses       4060     4059    -1     
Flag Coverage Δ
conformance 36.47% <100.00%> (+0.15%) ⬆️
e2e 41.71% <100.00%> (+0.55%) ⬆️
integration 32.91% <100.00%> (+0.01%) ⬆️
rust 0.00% <ø> (ø)
unit 92.22% <100.00%> (+<0.01%) ⬆️
unit-migrate 92.24% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@rissson
rissson force-pushed the tasks-dependencies branch from d7abd7e to 1c63bb4 Compare June 15, 2026 16:26
@netlify

netlify Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit a94c619
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a33c9951158450008c8fa50
😎 Deploy Preview https://deploy-preview-23064--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@netlify

netlify Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit a94c619
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a33c9957f1eac0008e1c6cb
😎 Deploy Preview https://deploy-preview-23064--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

rissson added 2 commits June 16, 2026 14:04
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@github-actions

github-actions Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-a94c6196ebe6021a310ad4f3e158dfbaf113e155
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-a94c6196ebe6021a310ad4f3e158dfbaf113e155

Afterwards, run the upgrade commands from the latest release notes.

rissson added 2 commits June 16, 2026 14:55
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@rissson
rissson marked this pull request as ready for review June 16, 2026 13:24
@rissson
rissson requested review from a team as code owners June 16, 2026 13:24
@rissson rissson moved this from Todo to Needs review in authentik Core Jun 16, 2026

@dewi-tik dewi-tik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs approval

@BeryJu BeryJu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I think @gergosimonyi would prefer a concrete m2m through model

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@rissson
rissson requested a review from BeryJu June 17, 2026 11:44
@rissson
rissson requested a review from gergosimonyi June 17, 2026 11:44
Comment thread authentik/tasks/models.py Resolved
@rissson
rissson enabled auto-merge (squash) June 18, 2026 10:34
@github-project-automation github-project-automation Bot moved this from Needs review to In Progress in authentik Core Jun 18, 2026
@rissson
rissson merged commit 5cf38ee into main Jun 18, 2026
162 of 164 checks passed
@rissson
rissson deleted the tasks-dependencies branch June 18, 2026 12:19
@github-project-automation github-project-automation Bot moved this from In Progress to Done in authentik Core Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants