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

Add GET workflows/runs/run_id endpoint #973

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Oct 15, 2024

Important

Add GET /workflows/runs/{workflow_run_id} endpoint to retrieve workflow run status with error handling for not found cases.

  • Endpoints:
    • Add GET /workflows/runs/{workflow_run_id} endpoint in agent_protocol.py to retrieve workflow run status by workflow_run_id.
    • Includes a variant with a trailing slash, not included in schema.
  • Service Logic:
    • Add build_workflow_run_status_response_by_workflow_id() in service.py to construct response using workflow_run_id.
    • Handles case where workflow run is not found by logging an error and raising WorkflowRunNotFound.

This description was created by Ellipsis for 5084fdf. It will automatically update as commits are pushed.

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Add `GET /workflows/runs/{workflow_run_id}` endpoint to retrieve workflow run status by `workflow_run_id`, with error handling for not found cases.
>
>   - **Endpoints**:
>     - Add `GET /workflows/runs/{workflow_run_id}` endpoint in `agent_protocol.py` to retrieve workflow run status by `workflow_run_id`.
>     - Includes a variant with a trailing slash, not included in schema.
>   - **Service Logic**:
>     - Add `build_workflow_run_status_response_by_workflow_id()` in `service.py` to construct response using `workflow_run_id`.
>     - Handles case where workflow run is not found by logging an error and raising `WorkflowRunNotFound`.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for ec0c2ddda325736be86fbc872563d727bb71b146. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
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! Reviewed everything up to 5084fdf in 19 seconds

More details
  • Looked at 59 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/sdk/routes/agent_protocol.py:653
  • Draft comment:
    The function name get_workflow_run_by_run_id is misleading as it suggests it retrieves a workflow run by workflow_id, but it actually uses workflow_run_id. Consider renaming it to get_workflow_run_by_workflow_run_id for clarity. This also applies to the function build_workflow_run_status_response_by_workflow_id in service.py.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The function get_workflow_run_by_run_id in agent_protocol.py and build_workflow_run_status_response_by_workflow_id in service.py are using the term workflow_id in their names, which is misleading since they are actually dealing with workflow_run_id. This can cause confusion for future developers.

Workflow ID: wflow_Nlh79wXnVgylUioT


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. Incremental review on 5084fdf in 43 seconds

More details
  • Looked at 59 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_Uex4ycs5wxwdwqnY


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.

@@ -612,6 +612,22 @@ async def get_last_task_for_workflow_run(self, workflow_run_id: str) -> Task | N
async def get_tasks_by_workflow_run_id(self, workflow_run_id: str) -> list[Task]:
return await app.DATABASE.get_tasks_by_workflow_run_id(workflow_run_id=workflow_run_id)

async def build_workflow_run_status_response_by_workflow_id(
Copy link
Contributor

Choose a reason for hiding this comment

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

The function name build_workflow_run_status_response_by_workflow_id is misleading. Consider renaming it to build_workflow_run_status_response_by_run_id to better reflect its purpose.

@msalihaltun msalihaltun merged commit cd43bd6 into main Oct 15, 2024
2 checks passed
@msalihaltun msalihaltun deleted the salih/query-workflow-run-by-run-id-only branch October 15, 2024 13:26
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.

2 participants