-
Notifications
You must be signed in to change notification settings - Fork 535
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
Implement get workflow runs endpoint #558
Conversation
<!-- ELLIPSIS_HIDDEN --> | 🚀 | This description was created by [Ellipsis](https://www.ellipsis.dev) for commit 97fb52dc2ee75066376dcde77fd269edce2921e6 | |--------|--------| ### Summary: Implemented endpoints to fetch workflow runs by `workflow_id`, `organization_id`, and `workflow_permanent_id` with pagination. **Key points**: - Added `get_workflow_runs_by_workflow_id` method in `skyvern/forge/sdk/db/client.py` to fetch workflow runs by `workflow_id` and `organization_id` with pagination. - Added `get_workflow_runs` method in `skyvern/forge/sdk/db/client.py` to fetch workflow runs by `organization_id` with pagination. - Added `get_workflow_runs_for_workflow_permanent_id` method in `skyvern/forge/sdk/db/client.py` to fetch workflow runs by `workflow_permanent_id` and `organization_id` with pagination. - Introduced `get_workflow_runs_by_workflow_id` method in `skyvern/forge/sdk/workflow/service.py` to call the database method for fetching workflow runs by `workflow_id` and `organization_id`. - Introduced `get_workflow_runs` method in `skyvern/forge/sdk/workflow/service.py` to call the database method for fetching workflow runs by `organization_id`. - Introduced `get_workflow_runs_for_workflow_permanent_id` method in `skyvern/forge/sdk/workflow/service.py` to call the database method for fetching workflow runs by `workflow_permanent_id` and `organization_id`. - Created `get_workflow_runs` endpoint in `skyvern/forge/sdk/routes/agent_protocol.py` to expose the functionality via API. - Created `get_workflow_runs_for_workflow_permanent_id` endpoint in `skyvern/forge/sdk/routes/agent_protocol.py` to expose the functionality via API. ---- Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev) <!-- ELLIPSIS_HIDDEN -->
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.
👍 Looks good to me! Incremental review on 7d3dc50 in 44 seconds
More details
- Looked at
149
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/service.py:367
- Draft comment:
The method signature forget_workflow_runs
incorrectly includes aworkflow_id
parameter which is not used. This should be removed to match the actual usage and the corresponding database method signature.
async def get_workflow_runs(self, organization_id: str, page: int = 1, page_size: int = 10) -> list[WorkflowRun]:
- Reason this comment was not posted:
Based on historical feedback, this comment is too similar to comments previously marked by users as bad.
Workflow ID: wflow_g49fEUlKzysmkso1
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
❌ Changes requested. Reviewed everything up to 7d3dc50 in 59 seconds
More details
- Looked at
150
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_5g9HaNVlJMDhMnWg
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -364,6 +364,19 @@ async def delete_workflow_by_permanent_id( | |||
organization_id=organization_id, | |||
) | |||
|
|||
async def get_workflow_runs(self, organization_id: str, page: int = 1, page_size: int = 10) -> list[WorkflowRun]: |
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 implementation of get_workflow_runs
and get_workflow_runs_for_workflow_permanent_id
methods incorrectly uses organization_id
for filtering workflow runs. These methods should filter based on workflow_id
and workflow_permanent_id
respectively to correctly fetch the desired workflow runs. Please adjust the database queries accordingly.
Summary:
Implemented endpoints to fetch workflow runs by
workflow_id
,organization_id
, andworkflow_permanent_id
with pagination.Key points:
get_workflow_runs_by_workflow_id
method inskyvern/forge/sdk/db/client.py
to fetch workflow runs byworkflow_id
andorganization_id
with pagination.get_workflow_runs
method inskyvern/forge/sdk/db/client.py
to fetch workflow runs byorganization_id
with pagination.get_workflow_runs_for_workflow_permanent_id
method inskyvern/forge/sdk/db/client.py
to fetch workflow runs byworkflow_permanent_id
andorganization_id
with pagination.get_workflow_runs_by_workflow_id
method inskyvern/forge/sdk/workflow/service.py
to call the database method for fetching workflow runs byworkflow_id
andorganization_id
.get_workflow_runs
method inskyvern/forge/sdk/workflow/service.py
to call the database method for fetching workflow runs byorganization_id
.get_workflow_runs_for_workflow_permanent_id
method inskyvern/forge/sdk/workflow/service.py
to call the database method for fetching workflow runs byworkflow_permanent_id
andorganization_id
.get_workflow_runs
endpoint inskyvern/forge/sdk/routes/agent_protocol.py
to expose the functionality via API.get_workflow_runs_for_workflow_permanent_id
endpoint inskyvern/forge/sdk/routes/agent_protocol.py
to expose the functionality via API.Generated with ❤️ by ellipsis.dev