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 workflow streaming #892

Merged
merged 1 commit into from
Sep 30, 2024
Merged

Conversation

ykeremy
Copy link
Contributor

@ykeremy ykeremy commented Sep 30, 2024

Important

Adds WebSocket streaming for real-time task and workflow updates, with status utilities and UI enhancements in TaskActions.tsx, types.ts, and WorkflowRun.tsx.

  • Streaming Functionality:
    • Adds WebSocket streaming for tasks in TaskActions.tsx and workflows in WorkflowRun.tsx.
    • Handles WebSocket connection lifecycle (open, message, close).
    • Displays real-time status updates and screenshots.
  • Status Utilities:
    • Adds statusIsNotFinalized and statusIsRunningOrQueued functions in types.ts to check task and workflow statuses.
  • UI Updates:
    • Updates TaskActions.tsx and WorkflowRun.tsx to show streaming status messages based on task/workflow status.
    • Modifies UI components to handle streaming states and display appropriate messages.

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

…src/'

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Adds WebSocket streaming for real-time task and workflow updates, with status utilities and UI enhancements in `TaskActions.tsx`, `types.ts`, and `WorkflowRun.tsx`.
>
>   - **Streaming Functionality**:
>     - Adds WebSocket streaming for tasks in `TaskActions.tsx` and workflows in `WorkflowRun.tsx`.
>     - Displays real-time status updates and screenshots.
>     - Handles WebSocket connection lifecycle (open, message, close).
>   - **Status Utilities**:
>     - Adds `statusIsNotFinalized` and `statusIsRunningOrQueued` functions in `types.ts` to check task and workflow statuses.
>   - **UI Updates**:
>     - Updates `TaskActions.tsx` and `WorkflowRun.tsx` to show streaming status messages based on task/workflow status.
>     - Modifies UI components to handle streaming states and display appropriate messages.
>
> <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 f91a0858b76e3cc6a88f74b6b26b7af1a741014b. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
@ykeremy ykeremy added the sync label Sep 30, 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 4e4e721 in 12 seconds

More details
  • Looked at 304 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/WorkflowRun.tsx:166
  • Draft comment:
    Consider encapsulating the WebSocket closing logic in a function to ensure consistency and avoid potential errors.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The WebSocket connection is being closed and set to null in multiple places. This could lead to potential issues if the socket is accessed after being set to null. It's better to encapsulate this logic in a function to ensure consistency and avoid potential errors.
2. skyvern-frontend/src/routes/workflows/WorkflowRun.tsx:135
  • Draft comment:
    Consider encapsulating the WebSocket closing logic in a function to ensure consistency and avoid potential errors.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The WebSocket connection is being closed and set to null in multiple places. This could lead to potential issues if the socket is accessed after being set to null. It's better to encapsulate this logic in a function to ensure consistency and avoid potential errors.

Workflow ID: wflow_2obuu26VvXebPLUp


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.

👍 Looks good to me! Reviewed everything up to 4e4e721 in 21 seconds

More details
  • Looked at 304 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/WorkflowRun.tsx:166
  • Draft comment:
    Ensure the WebSocket connection is properly closed to prevent memory leaks or unexpected behavior. Consider using a cleanup function in the useEffect hook.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. skyvern-frontend/src/routes/tasks/detail/TaskActions.tsx:58
  • Draft comment:
    Consider using the statusIsRunningOrQueued function consistently to check if a task is running or queued. This will improve code readability and maintainability. This comment also applies to other instances where task status is checked directly.
  • Reason this comment was not posted:
    Marked as duplicate.
3. skyvern-frontend/src/routes/workflows/WorkflowRun.tsx:70
  • Draft comment:
    Consider using the statusIsRunningOrQueued function consistently to check if a workflow is running or queued. This will improve code readability and maintainability. This comment also applies to other instances where workflow status is checked directly.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_LomMjUYdSzu5BJzp


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@msalihaltun msalihaltun merged commit 7a283dd into main Sep 30, 2024
2 checks passed
@msalihaltun msalihaltun deleted the salih/workflow-run-streaming-frontend branch September 30, 2024 18:36
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