Skip to content

fix(pipelinerun): add missing sort logic for childRefs array#9356

Closed
vdemeester wants to merge 1 commit intotektoncd:release-v1.6.xfrom
vdemeester:fix-sort-childrefs-v1.6.x
Closed

fix(pipelinerun): add missing sort logic for childRefs array#9356
vdemeester wants to merge 1 commit intotektoncd:release-v1.6.xfrom
vdemeester:fix-sort-childrefs-v1.6.x

Conversation

@vdemeester
Copy link
Member

This is a manual cherry-pick fix for #9295 to release-v1.6.x.

Problem

The previous cherry-pick (#9314) only included the test file changes (removing cmpopts.SortSlices) but not the actual sorting logic in pipelinerun.go. This caused the tests to fail because they expected sorted output but the production code wasn't sorting.

Solution

This commit adds the missing sort.Slice call that sorts childRefs by:

  1. PipelineTaskName
  2. Name
  3. Kind

This prevents excessive status updates caused by unordered arrays, which was the original goal of #9295.

Testing

  • Ran TestUpdatePipelineRunStatusFromChildRefs - all tests pass

/kind bug

Release Notes

Fix missing sort logic for childRefs array to prevent excessive apiserver status updates

The previous cherry-pick (tektoncd#9314) only included the test file changes
(removing cmpopts.SortSlices) but not the actual sorting logic in
pipelinerun.go. This caused tests to fail because they expected sorted
output but the production code wasn't sorting.

This commit adds the missing sort.Slice call that sorts childRefs by
PipelineTaskName, then Name, then Kind to prevent excessive status
updates caused by unordered arrays.

Cherry-pick of the missing part from tektoncd#9295.

Signed-off-by: Vincent Demeester <[email protected]>
Co-Authored-By: Claude <[email protected]>
@tekton-robot tekton-robot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Feb 4, 2026
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from vdemeester after the PR has been reviewed.

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

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 4, 2026
@vdemeester vdemeester closed this Feb 4, 2026
@github-project-automation github-project-automation bot moved this from Todo to Done in Tekton Community Roadmap Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants