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

Revert "refactor loopblock value" #1380

Merged

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Dec 12, 2024

Reverts Skyvern-AI/skyvern-cloud#3153


Important

Reverts loop block value refactoring by removing specific exceptions and simplifying ForLoopBlock parameter handling.

  • Exceptions:
    • Removed FailedToFormatJinjaStyleParameter and NoIterableValueFound exceptions from exceptions.py.
  • ForLoopBlock:
    • Reverted loop_over to be non-optional in block.py.
    • Removed loop_variable_reference handling in block.py and yaml.py.
    • Simplified get_loop_over_parameter_values() in block.py by removing Jinja template parsing.
  • Service:
    • Removed handling of loop_variable_reference in service.py.
    • Adjusted block_yaml_to_block() to not consider loop_variable_reference in service.py.

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

Reverts Skyvern-AI/skyvern-cloud#3153
<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Reverts loop block value refactoring by removing specific exceptions and simplifying `ForLoopBlock` parameter handling.
>
>   - **Exceptions**:
>     - Removed `FailedToFormatJinjaStyleParameter` and `NoIterableValueFound` exceptions from `exceptions.py`.
>   - **ForLoopBlock**:
>     - Reverted `loop_over` to be non-optional in `block.py`.
>     - Removed `loop_variable_reference` handling in `block.py` and `yaml.py`.
>     - Simplified `get_loop_over_parameter_values()` in `block.py` by removing Jinja template parsing.
>   - **Service**:
>     - Removed handling of `loop_variable_reference` in `service.py`.
>     - Adjusted `block_yaml_to_block()` to not consider `loop_variable_reference` in `service.py`.
>
> <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 75944d8fd7e03353612cddfed1396e8cb1e4ca93. 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.

❌ Changes requested. Reviewed everything up to 6000feb in 54 seconds

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

Workflow ID: wflow_8fikgSpkLdVof5Z2


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.

status=BlockStatus.failed,
)

loop_over_values = self.get_loop_over_parameter_values(workflow_run_context)
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing exception handling for get_loop_over_parameter_values can lead to unhandled exceptions. Consider re-adding exception handling to provide clear error messages and prevent unexpected failures.

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 6000feb in 1 minute and 18 seconds

More details
  • Looked at 199 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/models/block.py:725
  • Draft comment:
    Removing exception handling in the execute method of ForLoopBlock can lead to unhandled exceptions. Consider adding back exception handling to provide clear error messages and prevent unexpected failures.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_pFJUiWTmzMqSXovx


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.

@@ -748,15 +725,7 @@ async def execute_loop_helper(

async def execute(self, workflow_run_id: str, **kwargs: dict) -> BlockResult:
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing exception handling for get_loop_over_parameter_values can lead to unhandled exceptions during execution. Consider adding back exception handling to provide clear error messages and prevent unexpected failures.

else:
raise NoIterableValueFound()
raise NotImplementedError
Copy link
Contributor

Choose a reason for hiding this comment

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

Raising NotImplementedError instead of a specific exception like NoIterableValueFound can make debugging more difficult. Consider using a more descriptive exception to improve error handling and clarity.

@wintonzheng wintonzheng merged commit f5691d5 into main Dec 12, 2024
2 checks passed
@wintonzheng wintonzheng deleted the revert-3153-repo-sync/lawy/refactor-loopblock-value branch December 12, 2024 18:06
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.

1 participant