Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: Wireless cyclic index remains unchanged

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 23, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shaohuzhang1 shaohuzhang1 merged commit 525e209 into v2 Sep 23, 2025
4 of 5 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_loop branch September 23, 2025 04:43
index += 1


def loop(workflow_manage_new_instance, node: INode, generate_loop):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The generate_while_loop function is working correctly as it generates an infinite sequence of tuples starting from the given current_index. However, there are a couple of minor improvements and suggestions:

  1. Variable Naming: The variable name 'index' is used twice within the function without distinction in their meanings. Consider renaming one of them to avoid confusion.

  2. Docstring: It’s good practice to include a docstring at the top of functions that explain what they do, their parameters, return value, and if applicable, any assumptions or caveats with the implementation.

Here's the modified code with these suggestions:

@@ -115,8 +115,9 @@ def generate_whiled_loop(current_index: int):
     # Use the first 'index' for clarity
     start_index = current_index

     # Generate an infinite loop
     while True:
         yield start_index, start_index
         start_index += 1


def loop(workflow_manage_new_instance, node: INode, generate_while_loop):

Updated Docstrings (if needed):

For example,

def generate_while_loop(current_index: int) -> Iterable[Tuple[int, int]]:
    """Generate an infinite sequence of (index, index) pairs starting from the current index."""
    start_index = current_index

    while True:
        yield start_index, start_index
        start_index += 1


def loop(
    workflow_manage_new_instance: WorkflowManageNewInstance,
    node: INode,
    generate_while_loop: Callable[[int], Iterable[Tuple[int, int]]],
) -> None:
    """Loop through nodes using the provided generator function."""
    # Implement logic using the generated while-loop iterator
    pass

These changes enhance the readability and maintainability of your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants