Skip to content

Conversation

@danfimov
Copy link
Contributor

@danfimov danfimov commented Nov 4, 2025

Changes

  • Add labels in the payloads sent by the TaskiqAdminMiddleware;
  • The TaskiqAdminMiddleware is now exported in the __init__.py file, making it available for import from the taskiq.middlewares;

Context

I want to implement action to run task with same parameters from admin panel (for retry by hand for example). It's already possible with args/kwargs, but I also want to kick task with same labels.

Copilot AI review requested due to automatic review settings November 4, 2025 10:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for including task labels in the TaskiqAdminMiddleware payloads sent to the admin API. The middleware now sends the labels field from TaskiqMessage to the admin API endpoints for both queued and started task events.

Key changes:

  • Added labels field to payloads in post_send and pre_execute methods
  • Updated test fixture to include complex label data with datetime objects, timedelta, and nested dictionaries
  • Enhanced test assertions to verify labels are included in payloads
  • Exported TaskiqAdminMiddleware in the middlewares init.py

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
taskiq/middlewares/taskiq_admin_middleware.py Added labels field to request payloads in post_send and pre_execute methods; refactored imports to use explicit module paths
tests/middlewares/test_taskiq_admin_middleware.py Added complex label data to test fixture and updated assertions to verify labels are included in payloads
taskiq/middlewares/init.py Exported TaskiqAdminMiddleware in module's public API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danfimov danfimov marked this pull request as draft November 4, 2025 10:21
@danfimov danfimov marked this pull request as ready for review November 4, 2025 10:35
@s3rius s3rius merged commit 5fd94be into taskiq-python:master Nov 5, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants