Skip to content

feat: add debug.list_tasks to expose GET /v1/tasks#2089

Open
muhammadshayan124 wants to merge 1 commit into
weaviate:mainfrom
muhammadshayan124:feature/debug-list-tasks
Open

feat: add debug.list_tasks to expose GET /v1/tasks#2089
muhammadshayan124 wants to merge 1 commit into
weaviate:mainfrom
muhammadshayan124:feature/debug-list-tasks

Conversation

@muhammadshayan124

Copy link
Copy Markdown

Summary

Adds a list_tasks() method to the sync and async client.debug namespace, wrapping the server's GET /v1/tasks distributed-tasks endpoint. This lets users inspect long-running background operations (e.g. reindexing) tracked across cluster nodes directly from the client, instead of shelling out to curl.

Closes #2059.

Changes

  • weaviate/debug/types.py: adds DistributedTask and DistributedTaskUnit pydantic models mirroring the server's DistributedTasks OpenAPI schema.
  • weaviate/debug/executor.py: adds list_tasks(), following the existing get_object_over_rest_api pattern in the same executor (executor.execute + _ExpectedStatusCodes).
  • weaviate/debug/sync.pyi / async_.pyi: type stubs for both sync and async variants.
  • weaviate/classes/debug.py: exports the new models.
  • mock_tests/test_debug.py: mock coverage for the populated and empty-response cases.
  • integration/test_client_debug.py: integration test stub following the existing debug test conventions.

Test plan

  • pytest mock_tests/test_debug.py — 2/2 passing
  • ruff check / ruff format --check on all changed files — clean
  • flake8 on all changed files — clean

Adds a list_tasks() method to the sync and async debug namespace that
calls the server's distributed-tasks endpoint, so users can inspect
long-running background operations (e.g. reindexing) tracked across
cluster nodes without shelling out to curl.

Includes DistributedTask/DistributedTaskUnit pydantic models mirroring
the server's DistributedTasks OpenAPI schema, mock tests covering the
populated and empty-response cases, and integration test stubs
following the existing debug test conventions.

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

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.

Add debug.list_tasks

2 participants