Skip to content

SRVKP-14864: add fix for undefined length issue in pipelinerun - #1413

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-pipelines:release-v1.23.xfrom
anwesha-palit-redhat:fix/SRVKP-14864
Oct 5, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openshift-pipelines:release-v1.23.xfrom
anwesha-palit-redhat:fix/SRVKP-14864

Conversation

@anwesha-palit-redhat

@anwesha-palit-redhat anwesha-palit-redhat commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Refactoring
  • Migration
  • CVE Fix

Summary

#1413 (comment)

Screen Recordings - Before

before-issue.mov

Screen Recordings - After

Screen.Recording.2026-10-05.at.13.45.35.mov

@openshift-ci-robot

openshift-ci-robot commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

@anwesha-palit-redhat: This pull request references SRVKP-14864 which is a valid jira issue.

Details

In response to this:

Type of Change

  • Bug fix
  • New feature
  • Refactoring
  • Migration
  • CVE Fix

Summary

Screen Recordings - Before

before-issue.mov

Screen Recordings - After

Screen.Recording.2026-10-05.at.13.45.35.mov

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the approved Label for Approved PRs label Oct 5, 2026
@anwesha-palit-redhat

Copy link
Copy Markdown
Contributor Author

/agentic_describe

@anwesha-palit-redhat
anwesha-palit-redhat removed the request for review from vdemeester October 5, 2026 08:55
@qodo-code-review

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Warning

/review is deprecated. Use /agentic_review instead (removal date not yet scheduled).

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missed Refetch

If etcdRuns temporarily becomes undefined, its previous length is reset to zero. When a shorter list arrives, this condition cannot detect the decrease, so the task-run refetch may be skipped. Consider preserving the previous length until a defined list arrives.

  etcdRuns?.length < prevLength
) {

@anwesha-palit-redhat

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-v1.24.x

@openshift-cherrypick-robot

Copy link
Copy Markdown
Contributor

@anwesha-palit-redhat: once the present PR merges, I will cherry-pick it on top of release-v1.24.x in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-v1.24.x

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.

@qodo-code-review

Copy link
Copy Markdown

Important

The /generate_labels command by Qodo is sunsetting on the 1st of October 2026 and will no longer be available. We recommend switching to the latest Qodo review capabilities. Learn more

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Prevent undefined-length errors when checking for pruned runs

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Guard the run-count comparison when the etcd run list is undefined.
• Preserve Tekton Results refetches when a loaded run list shrinks.
Diagram

graph TD
  W["Kubernetes watch"] --> R["useRuns hook"] --> G{"Loaded and fewer?"} --> K["Refetch key"] --> T["Tekton Results"]
  M["Multi-cluster runs"] --> R
Loading
High-Level Assessment

The targeted guard preserves the existing refetch behavior while preventing an undefined-length access. Normalizing the run list upstream would broaden this small fix without a demonstrated need.

Files changed (1) +1 / -1

Bug fix (1) +1 / -1
useTaskRuns.tsGuard the run-count decrease check +1/-1

Guard the run-count decrease check

• The useRuns effect now uses optional chaining when comparing the current etcd run count with the previous count. An undefined list no longer throws during this comparison, while a shorter defined list still triggers a Tekton Results refetch.

src/components/hooks/useTaskRuns.ts

@arvindk-softwaredev

Copy link
Copy Markdown
Contributor

verified in openshift cluster

pr.review.mov

@arvindk-softwaredev arvindk-softwaredev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Looks Good to Me Label label Oct 5, 2026
@openshift-ci

openshift-ci Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anwesha-palit-redhat, arvindk-softwaredev

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [anwesha-palit-redhat,arvindk-softwaredev]

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 71d467c into openshift-pipelines:release-v1.23.x Oct 5, 2026
2 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown
Contributor

@anwesha-palit-redhat: new pull request created: #1415

Details

In response to this:

/cherry-pick release-v1.24.x

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.

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

Labels

approved Label for Approved PRs Bug fix jira/valid-reference lgtm Looks Good to Me Label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants