Skip to content

SRVKP-12944: update download all logs callback method - #1214

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-pipelines:masterfrom
anwesha-palit-redhat:feat/SRVKP-12944
Jul 29, 2026
Merged

SRVKP-12944: update download all logs callback method#1214
openshift-merge-bot[bot] merged 1 commit into
openshift-pipelines:masterfrom
anwesha-palit-redhat:feat/SRVKP-12944

Conversation

@anwesha-palit-redhat

@anwesha-palit-redhat anwesha-palit-redhat commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Type of Change

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

Summary

#1214 (comment)

Screen Recordings for Download All

Screen.Recording.2026-07-27.at.16.50.37.mov

Screen Recordings for Download being enabled when in flight - bug before

DownloadEnabled.mov

Screen Recordings for Download being disabled when in flight - fix after

downloaddisabled.mov

@openshift-ci-robot

openshift-ci-robot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Type of Change

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

Summary

Screen Recordings / Screenshot

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 Jul 27, 2026
@anwesha-palit-redhat

Copy link
Copy Markdown
Contributor Author

/agentic_describe

@anwesha-palit-redhat anwesha-palit-redhat removed the approved Label for Approved PRs label Jul 27, 2026
@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: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing TaskRuns

Looking up TaskRuns with find by the pipelineTask label returns only the first match. Matrix, fan-out, or other scenarios with multiple TaskRuns sharing one pipeline-task label may therefore omit logs from the download. Validate these cases and consider grouping all matching TaskRuns.

const taskRun = taskRuns.find(
  (t) =>
    t?.metadata?.labels?.[TektonResourceLabel.pipelineTask] === currTask,
);
Possible Crash

The new label-based lookup can return undefined when a TaskRun lacks the expected label, but the code subsequently destructures status from taskRun. This would reject the download callback instead of gracefully skipping or handling the unmatched task.

const taskRun = taskRuns.find(
  (t) =>
    t?.metadata?.labels?.[TektonResourceLabel.pipelineTask] === currTask,
);
const pipelineTaskName =
  taskRun?.spec.taskRef?.name ?? taskRun?.metadata.name;
const { status } = taskRun;

@qodo-code-review qodo-code-review Bot added the enhancement New feature or request label Jul 27, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix download-all logs to resolve TaskRuns by pipelineTask label

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Resolve TaskRuns for "Download all logs" by tekton.dev/pipelineTask label instead of TaskRun
 name.
• Exclude child pipeline references when computing TaskRun names for log downloads.
• Harden PipelineRunLogs inputs with safe defaults and correct TaskRun counting.
Diagram

graph TD
  PRL["PipelineRunLogs (UI)"] -->|"builds taskRunNames"| LUC["Download logs callback"] --> LUT["TaskRun lookup (pipelineTask label)"] --> FL["Fetch logs (pods/results)"]
  PRL -->|"TaskRuns + child runs"| RUNS["Runs data"] --> LUT
Loading
High-Level Assessment

The PR’s approach is appropriate: tekton.dev/pipelineTask is the stable join key between pipeline tasks and their TaskRuns, and filtering out pipelineRef tasks prevents misclassification of child PipelineRuns. Considered pre-indexing TaskRuns into a Map to avoid repeated .find() calls, but the current implementation is clear and sufficient for typical run sizes.

Files changed (2) +26 / -11

Bug fix (2) +26 / -11
logs-utils.tsMatch TaskRuns by pipelineTask label when building download-all log URLs +18/-4

Match TaskRuns by pipelineTask label when building download-all log URLs

• Updates the download-all logs callbacks to locate TaskRuns using 'metadata.labels[tekton.dev/pipelineTask]' instead of 'metadata.name'. This aligns the lookup with the pipeline task names passed in from the UI and avoids missing logs when TaskRun names don’t equal task names.

src/components/logs/logs-utils.ts

PipelineRunLogs.tsxPass TaskRun-only task list to download-all logs and add defensive defaults +8/-7

Pass TaskRun-only task list to download-all logs and add defensive defaults

• Defaults 'taskRuns' and 'childPipelineRuns' props to empty arrays to avoid undefined handling. Builds a 'taskRunNames' list that excludes pipelineRef (child pipeline) tasks and computes 'taskCount' based only on TaskRuns, ensuring the download-all callback receives the correct task identifiers.

src/components/pipelineRuns-details/PipelineRunLogs.tsx

@openshift-ci openshift-ci Bot added the approved Label for Approved PRs label Jul 27, 2026
@anwesha-palit-redhat anwesha-palit-redhat removed the approved Label for Approved PRs label Jul 27, 2026

@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 Jul 29, 2026
@openshift-ci

openshift-ci Bot commented Jul 29, 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-ci openshift-ci Bot added the approved Label for Approved PRs label Jul 29, 2026
@arvindk-softwaredev

Copy link
Copy Markdown
Contributor

verified the changes

pr-review.mov

@openshift-merge-bot
openshift-merge-bot Bot merged commit 8b075af into openshift-pipelines:master Jul 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Label for Approved PRs enhancement New feature or request jira/valid-reference lgtm Looks Good to Me Label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants