Skip to content
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

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

ykeremy
Copy link
Contributor

@ykeremy ykeremy commented Jul 5, 2024

🚀 This description was created by Ellipsis for commit 7d3dc50

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

<!-- 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 -->
@ykeremy ykeremy added the sync label Jul 5, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 in 3 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 for get_workflow_runs incorrectly includes a workflow_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.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 in 3 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]:
Copy link
Contributor

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.

@ykeremy ykeremy merged commit 8be94d7 into main Jul 5, 2024
2 checks passed
@ykeremy ykeremy deleted the ykeremy/get-workflow-runs-endpoint branch July 5, 2024 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant