feat: add debug.list_tasks to expose GET /v1/tasks#2089
Open
muhammadshayan124 wants to merge 1 commit into
Open
feat: add debug.list_tasks to expose GET /v1/tasks#2089muhammadshayan124 wants to merge 1 commit into
muhammadshayan124 wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
list_tasks()method to the sync and asyncclient.debugnamespace, wrapping the server'sGET /v1/tasksdistributed-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 tocurl.Closes #2059.
Changes
weaviate/debug/types.py: addsDistributedTaskandDistributedTaskUnitpydantic models mirroring the server'sDistributedTasksOpenAPI schema.weaviate/debug/executor.py: addslist_tasks(), following the existingget_object_over_rest_apipattern 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 passingruff check/ruff format --checkon all changed files — cleanflake8on all changed files — clean