Skip to content

tasks: aggregate status from logs instead of legacy field - #24792

Merged
melizeche merged 4 commits into
mainfrom
fix/task_log
Aug 11, 2026
Merged

melizeche merged 4 commits into
mainfrom
fix/task_log

Conversation

@melizeche

@melizeche melizeche commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Task.aggregated_status is set by a trigger that reads the _messages field. 0005_tasklog moved logs into the TaskLog table but left the trigger untouched, and nothing writes _messages anymore, so aggregated_status can only ever equal the task's state, and info/warning/error are unreachable.

As a result, tasks that log errors display as Done, the "exclude successful" task view matches nothing, and the status summary always reports zero for those levels. 13 non-test self.error() / self.warning() call sites are invisible in the UI. Tasks that raise are unaffected, rejected is a state, not log-derived.

How

  • Trigger aggregates over TaskLog, as explicit plpgsql IF/ELSE so the lookup only runs on the transition to done, hitting the existing (task_id, previous) index.
  • Batched backfill for tasks left on done despite warning/error logs; it reuses the trigger, so the query only selects affected rows.

Example

before with a broken blueprint: all good
image

after:

image

Checklist

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

@netlify

netlify Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 88f6371
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a7a2c02bd2dce0008c32601
😎 Deploy Preview https://deploy-preview-24792--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.

@netlify

netlify Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 88f6371
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a7a2c02cfb5e80008cc7742
😎 Deploy Preview https://deploy-preview-24792--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.

@netlify

netlify Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 88f6371
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a7a2c02054f9200082e5b5b
😎 Deploy Preview https://deploy-preview-24792--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 Aug 5, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #24792    +/-   ##
========================================
  Coverage   91.47%   91.48%            
========================================
  Files        1148     1150     +2     
  Lines       72323    72430   +107     
  Branches     3875     3875            
========================================
+ Hits        66160    66264   +104     
- Misses       6128     6131     +3     
  Partials       35       35            
Flag Coverage Δ
conformance 34.76% <0.00%> (-0.04%) ⬇️
e2e 39.44% <0.00%> (+0.14%) ⬆️
integration 31.32% <0.00%> (-0.04%) ⬇️
rust 38.89% <ø> (ø)
unit 91.33% <100.00%> (-1.79%) ⬇️
unit-migrate 93.16% <100.00%> (+0.01%) ⬆️

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.

@github-actions

github-actions Bot commented Aug 10, 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-a58eb8fccbbb5aeda97cbe781094b13779258775
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-a58eb8fccbbb5aeda97cbe781094b13779258775

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

Comment thread authentik/tasks/models.py Resolved
@rissson rissson changed the title [WIP] core: aggregate task status from logs instead of legacy field [WIP] tasks: aggregate status from logs instead of legacy field Aug 11, 2026
@BeryJu BeryJu changed the title [WIP] tasks: aggregate status from logs instead of legacy field tasks: aggregate status from logs instead of legacy field Aug 11, 2026
@BeryJu BeryJu added the backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 label Aug 11, 2026

@rissson rissson 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.

approving provided the added tests pass

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in authentik Core Aug 11, 2026
@melizeche melizeche added the backport/version-2026.5 Add this label to PRs to backport changes to version-2026.5 label Aug 11, 2026
@melizeche
melizeche marked this pull request as ready for review August 11, 2026 16:44
@melizeche
melizeche requested a review from a team as a code owner August 11, 2026 16:44

@rissson rissson 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.

approving pending one change

@melizeche
melizeche enabled auto-merge (squash) August 11, 2026 19:52
@melizeche
melizeche merged commit 3cb4b99 into main Aug 11, 2026
233 of 238 checks passed
@melizeche
melizeche deleted the fix/task_log branch August 11, 2026 20:03
@github-project-automation github-project-automation Bot moved this from In Progress to Done in authentik Core Aug 11, 2026
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.8 created: #25004

@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.5 created: #25005

melizeche added a commit that referenced this pull request Aug 11, 2026
…#24792 to version-2026.8) (#25004)

tasks: aggregate status from logs instead of legacy field (#24792)

* aggregate task status from logs instead of legacy field

* remove comment

* remove backfill of tasks

Co-authored-by: Marcelo Elizeche Landó <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.5 Add this label to PRs to backport changes to version-2026.5 backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants