-
Notifications
You must be signed in to change notification settings - Fork 1
feat: ability to filter executions by tool key #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if tool_key is not None: | ||
| import json | ||
|
|
||
| params["filter"] = json.dumps({"tool": {"toolManifest": {"key": tool_key}}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There was a problem hiding this 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 the ability to filter executions by tool key by introducing a new tool_key parameter to the executions.list() method. However, this change removes the existing filter parameter, which is a breaking change.
- Replaced the generic
filterparameter with a specifictool_keyparameter inexecutions.list() - Added JSON-based filter construction to map
tool_keyto the API's filter format - Added tests to verify the new filtering functionality
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/platform/executions.py | Replaced filter parameter with tool_key and added logic to construct JSON filter for tool manifest key matching |
| tests/test_executions.py | Added new test file with tests for listing executions and filtering by tool key |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| params["filter"] = filter | ||
|
|
||
| if tool_key is not None: | ||
| import json |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The json module should be imported at the top of the file with other imports (after line 10) rather than inside the function. This is inconsistent with Python best practices and the import style used in most other files in the codebase (e.g., src/auth.py, src/config.py, src/platform/client.py).
| page_size: int | None = None, | ||
| order: str | None = None, | ||
| filter: str | None = None, | ||
| tool_key: str | None = None, |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking API change. The filter parameter has been removed and replaced with tool_key. Existing code that uses the filter parameter (e.g., tests/test_tools_api.py:12 and src/platform/job.py:1647) will break with this change. Consider either keeping both parameters or providing a deprecation path.
tests/test_executions.py
Outdated
| data = client.executions.list(tool_key="deeporigin.bulk-docking") | ||
| executions = data.get("data", []) | ||
| assert isinstance(executions, list), "Expected a list" | ||
| assert len(executions) > 0, "Expected at least one execution" |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test assumes that the API will return at least one execution with the tool key "deeporigin.bulk-docking". This assumption makes the test fragile - it will fail if no executions exist for this tool. Consider using a mock or creating test data, or handle the case where no executions exist more gracefully.
| if tool_key is not None: | ||
| import json | ||
|
|
||
| params["filter"] = json.dumps({"tool": {"toolManifest": {"key": tool_key}}}) |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filter construction uses hardcoded nested structure without validation. If tool_key is an empty string or contains special characters that need escaping in JSON, this could lead to unexpected behavior. Consider adding validation for the tool_key parameter before constructing the filter.
No description provided.