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

show error for invalid schema in extraction, text prompt, pdf parser #1696

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Feb 1, 2025

Important

Adds JSON schema validation for extraction, text prompt, and pdf parser nodes, with type guards for PDFParserNode and TextPromptNode.

  • Error Handling:
    • Adds JSON schema validation for extraction, text prompt, and pdf parser nodes in getWorkflowErrors() in workflowEditorUtils.ts.
  • Type Guards:
    • Adds isPdfParserNode() in PDFParserNode/types.ts.
    • Adds isTextPromptNode() in TextPromptNode/types.ts.

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

…src/'

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Add JSON schema validation and type guards for PDFParserNode, TextPromptNode, and extraction nodes in workflow editor.
>
>   - **Error Handling**:
>     - Add JSON schema validation for `PDFParserNode`, `TextPromptNode`, and extraction nodes in `getWorkflowErrors()` in `workflowEditorUtils.ts`.
>   - **Type Guards**:
>     - Add `isPdfParserNode()` and `isTextPromptNode()` functions in `PDFParserNode/types.ts` and `TextPromptNode/types.ts` respectively.
>   - **Imports**:
>     - Import `isPdfParserNode` and `isTextPromptNode` in `workflowEditorUtils.ts`.
>
> <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 51f0a774f54bd4739a1c58bb13d4056bbfa3badb. 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! Incremental review on 79a7f49 in 10 seconds

More details
  • Looked at 96 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:1928
  • Draft comment:
    Consider refactoring the JSON parsing logic into a utility function to reduce redundancy. This logic is repeated for multiple node types (e.g., task, validation, extraction, textPrompt, pdfParser).
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The JSON parsing logic is repeated multiple times across different node types. This can be refactored into a utility function to improve code maintainability and reduce redundancy.

Workflow ID: wflow_GYzyAPkDjHgADXfS


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 79a7f49 in 1 minute and 0 seconds

More details
  • Looked at 96 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:1908
  • Draft comment:
    Consider refactoring the JSON parsing logic into a utility function to avoid repetition and improve maintainability. This applies to lines 1846, 1867, 1872, 1881, 1908, 1917, and 1926.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The JSON parsing logic is repeated multiple times across different node types. This can be refactored to a utility function to improve code maintainability and readability.

Workflow ID: wflow_0cGK1Ox9GhQaOyxj


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

@msalihaltun msalihaltun merged commit fc7cc20 into main Feb 1, 2025
7 checks passed
@msalihaltun msalihaltun deleted the salih/show-error-for-invalid-schemas branch February 1, 2025 08:31
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