Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: In the execution details, the display order of the child nodes of the loop body is incorrect

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 8, 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.

).sort((x: any, y: any) => (x.index || 0) - (y.index || 0))"
:key="cIndex"
>
<ExecutionDetailCard :data="cLoop"></ExecutionDetailCard>
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 provided line introduces a bug in the code. In JavaScript ES6 Object.values, when used to iterate over object properties, it returns an array of values that correspond to those properties without keys. The subsequent .sort() operation expects two parameters for comparison, but the current implementation only references one ((x: any)). To sort objects by a specific property like "index", you need to access that property within the sorting function.

Here is the corrected version of the line:

v-for="(cLoop, cIndex) in Object.values(data.loop_node_data?.[currentLoopNode] || []).sort((x: any, y: any) => (x.index || 0) - (y.index || 0))"

By adding another reference to (y.index || 0) before subtracting from each other, the function now correctly sorts the objects based on their index attribute, assuming all elements have at least an index field or default to zero if missing.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 8, 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 f665b5f into v2 Dec 8, 2025
3 of 5 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_workflow branch December 8, 2025 08:58
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