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

UrlBlock - a block to navigate to a url #1461

Merged
merged 2 commits into from
Jan 2, 2025
Merged

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Jan 2, 2025

Important

Add UrlBlock and UrlBlockYAML for URL navigation in workflows with YAML configuration support.

  • New Feature:
    • Add UrlBlock class in block.py for URL navigation in workflows.
    • Implements execute() method in UrlBlock for URL navigation and error handling.
  • YAML Support:
    • Add UrlBlockYAML class in yaml.py for YAML configuration of UrlBlock.
    • Update BLOCK_YAML_SUBCLASSES and BLOCK_YAML_TYPES to include UrlBlockYAML.

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

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 cb50d97 in 1 minute and 59 seconds

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

Workflow ID: wflow_jVv8fXYlRQqHsmqE


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.

block_type: Literal[BlockType.GOTO_URL] = BlockType.GOTO_URL
url: str

async def execute(
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using prepend_scheme_and_validate_url to validate the URL before navigation to ensure it is well-formed.

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 a891ee3 in 35 seconds

More details
  • Looked at 89 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/models/block.py:1809
  • Draft comment:
    The UrlBlock class is missing the execute method, which is necessary for its functionality. The PR description mentions implementing the execute() method, but it is not present in the code.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment is incorrect. The UrlBlock is inheriting from BaseTaskBlock which already has an execute() implementation. This is actually a refactoring to remove duplicate code by reusing the BaseTaskBlock's execute() method. The PR is making the code better by reducing duplication.
    Could there be a reason why UrlBlock needed its own custom execute() implementation that's being lost in this change?
    Looking at the old execute() implementation, it was doing the same basic task handling and browser management that BaseTaskBlock does. There's no special functionality being lost - this is a clean refactoring.
    The comment is incorrect and should be deleted. The execute() method isn't missing - it's intentionally inheriting the implementation from BaseTaskBlock as part of a good refactoring.

Workflow ID: wflow_PWcIcdcziyFUIBmo


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

@wintonzheng wintonzheng force-pushed the shu/add_go_to_url_block branch from a891ee3 to ca18f3e Compare January 2, 2025 03:25
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 ca18f3e in 37 seconds

More details
  • Looked at 114 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/models/block.py:1805
  • Draft comment:
    The UrlBlock class is missing an execute method. This method is essential for the block to perform its intended function of navigating to a URL. Please reintroduce the execute method with the necessary logic.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment suggests adding back the execute method, but this would be incorrect. The change to inherit from BaseTaskBlock is intentional and good - it reuses the common task execution logic. The old execute method was duplicating functionality that already exists in BaseTaskBlock. The comment shows a misunderstanding of the codebase architecture.
    Could there be some special URL handling logic in the old execute method that was important to preserve? Could this change break existing functionality?
    Looking at the old execute method, it was just doing basic URL navigation which BaseTaskBlock already handles. There's no special logic being lost. The change actually reduces code duplication and improves maintainability.
    The comment should be deleted. The change to inherit from BaseTaskBlock is correct and the execute method is not missing - it's properly inherited from BaseTaskBlock.

Workflow ID: wflow_11DOrfYfdBAFjs9s


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

@wintonzheng wintonzheng merged commit b5d6e41 into main Jan 2, 2025
2 checks passed
@wintonzheng wintonzheng deleted the shu/add_go_to_url_block branch January 2, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant