-
Notifications
You must be signed in to change notification settings - Fork 823
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
fix restart workflow run #1481
fix restart workflow run #1481
Conversation
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Adds deletion of workflow run blocks during workflow run reset by introducing `delete_workflow_run_blocks` in `client.py` and updating `reset_workflow_run` in `workflows.py`. > > - **Behavior**: > - In `reset_workflow_run` in `workflows.py`, added call to `delete_workflow_run_blocks` to remove workflow run blocks during reset. > - **Database**: > - Added `delete_workflow_run_blocks` function in `client.py` to delete `WorkflowRunBlockModel` entries by `workflow_run_id` and `organization_id`. > > <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 475d8eb41f51d7f9ebffae0290d7a15daa8a9e39. It will automatically update as commits are pushed.</sup> <!-- 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 bc3fe61 in 43 seconds
More details
- Looked at
22
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. skyvern/forge/sdk/db/client.py:2135
- Draft comment:
Consider handling the case whereorganization_id
isNone
indelete_workflow_run_blocks
to avoid unintended deletions. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
- The function accepts organization_id as optional (str | None)
- The SQL where clause uses organization_id directly without checking if it's None
- Looking at usage patterns in the codebase, organization_id is used similarly in many other functions
- SQLAlchemy handles None values in where clauses appropriately - it will match NULL values
- There's no evidence this has caused any issues
I could be wrong about SQLAlchemy's handling of None values in where clauses. Maybe there's a subtle issue I'm missing.
SQLAlchemy is well-known for handling None values correctly in where clauses, converting them to SQL NULL. The codebase uses this pattern extensively without issues.
Delete this comment. SQLAlchemy handles None values appropriately in where clauses, and this pattern is used consistently throughout the codebase.
Workflow ID: wflow_trY3Y4I3yoIMT5X2
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 bc3fe61 in 54 seconds
More details
- Looked at
22
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_A6S50ZAQ0ocqGEkL
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.
stmt = delete(WorkflowRunBlockModel).where( | ||
and_( | ||
WorkflowRunBlockModel.workflow_run_id == workflow_run_id, | ||
WorkflowRunBlockModel.organization_id == organization_id, |
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.
Consider handling the case where organization_id
is None
to avoid unintended deletions. You can use a conditional filter to only apply the organization_id filter if it is not None
.
Important
Adds
delete_workflow_run_blocks
inclient.py
and updatesreset_workflow_run
inworkflows.py
to delete workflow run blocks during reset.reset_workflow_run
inworkflows.py
, added call todelete_workflow_run_blocks
to remove workflow run blocks during reset.delete_workflow_run_blocks
function inclient.py
to deleteWorkflowRunBlockModel
entries byworkflow_run_id
andorganization_id
.This description was created by for bc3fe61. It will automatically update as commits are pushed.