Skip to content

SRVKP-11395: Refactor: Inline useTaskRun, useTaskRuns2, and usePipelineRun wrappers into their consumers#1037

Open
anwesha-palit-redhat wants to merge 1 commit intoopenshift-pipelines:masterfrom
anwesha-palit-redhat:fix/SRVKP-11395
Open

SRVKP-11395: Refactor: Inline useTaskRun, useTaskRuns2, and usePipelineRun wrappers into their consumers#1037
anwesha-palit-redhat wants to merge 1 commit intoopenshift-pipelines:masterfrom
anwesha-palit-redhat:fix/SRVKP-11395

Conversation

@anwesha-palit-redhat
Copy link
Copy Markdown
Contributor

@anwesha-palit-redhat anwesha-palit-redhat commented Apr 15, 2026

Summary

No logical or functional changes are added in this PR

  • Removes three thin wrapper hooks (useTaskRuns2, useTaskRun, usePipelineRun) that only delegated to useRuns, inlining their logic at the call sites in TaskRunDetailsPage and PipelineRunDetailsPage.
  • Adds name and limit options to UseTaskRunsOptions and usePipelineRuns so consumers can fetch a single resource by name without needing a dedicated wrapper hook.
  • Removed the useMemo in useRuns
  • Rectifies the array de-structuring in PipelineRunVisualization

Details

Change Impact
useTaskRuns2 removed Was a pass-through to useRuns<TaskRunKind>. useTaskRuns now calls useRuns directly.
useTaskRun removed TaskRunDetailsPage now calls useTaskRuns with { name, limit: 1 } and picks [0]. Error-suppression logic in the old wrapper was unused by the consumer.
usePipelineRun removed PipelineRunDetailsPage now calls usePipelineRuns with { name, limit: 1 } and picks [0]. Same — error-suppression was unused.
useMemo removed from useRuns return Fixes stale multi-cluster state (mcPendingAdmission, mcProxyUnavailable, effectiveLoaded, effectiveError were missing from the dep array).

Screen recording

PipelineRun and TaskRun Details Page

PipelineDetailsClusterWorking.mov
PipelineRunRunningWorking.mov

The logs do not show up in this one as the loki setup is not done in this cluster

PipelineRunArchivedWorking.mov

Pipeline Overview Page navigation

OverviewPageNavigation.mov

Pipeline Metrics Page navigation with OSP 1.21.1 and OCP 4.21

PipelineMetricsNavigationOSP1.21.1OCP4.21.mov

Pipeline Metrics Page navigation with latest changes and OCP 4.22

PipelineMetrics_OSP_master_OCP_4.22.mov

@openshift-ci-robot
Copy link
Copy Markdown
Collaborator

openshift-ci-robot commented Apr 15, 2026

@anwesha-palit-redhat: This pull request references SRVKP-11395 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:

Summary

  • Removes three thin wrapper hooks (useTaskRuns2, useTaskRun, usePipelineRun) that only delegated to useRuns, inlining their logic at the call sites in TaskRunDetailsPage and PipelineRunDetailsPage.
  • Adds name and limit options to UseTaskRunsOptions and usePipelineRuns so consumers can fetch a single resource by name without needing a dedicated wrapper hook.
  • Fixes a stale-value bug in useRuns where the return useMemo had an incomplete dependency array — it referenced loaded/error instead of effectiveLoaded/effectiveError and was missing shouldUseMultiCluster, mcPendingAdmission, and mcProxyUnavailable.
  • Rectifies the array de-structuring in PipelineRunVisualization

Details

Change Impact
useTaskRuns2 removed Was a pass-through to useRuns<TaskRunKind>. useTaskRuns now calls useRuns directly.
useTaskRun removed TaskRunDetailsPage now calls useTaskRuns with { name, limit: 1 } and picks [0]. Error-suppression logic in the old wrapper was unused by the consumer.
usePipelineRun removed PipelineRunDetailsPage now calls usePipelineRuns with { name, limit: 1 } and picks [0]. Same — error-suppression was unused.
useMemo removed from useRuns return Fixes stale multi-cluster state (mcPendingAdmission, mcProxyUnavailable, effectiveLoaded, effectiveError were missing from the dep array).

Screen recording

PipelineRun and TaskRun Details Page

PipelineDetailsClusterWorking.mov
PipelineRunRunningWorking.mov

The logs do not show up in this one as the loki setup is not done in this cluster

PipelineRunArchivedWorking.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 Apr 15, 2026
@anwesha-palit-redhat anwesha-palit-redhat changed the base branch from main to master April 15, 2026 13:07
@openshift-ci-robot
Copy link
Copy Markdown
Collaborator

openshift-ci-robot commented Apr 15, 2026

@anwesha-palit-redhat: This pull request references SRVKP-11395 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:

Summary

  • Removes three thin wrapper hooks (useTaskRuns2, useTaskRun, usePipelineRun) that only delegated to useRuns, inlining their logic at the call sites in TaskRunDetailsPage and PipelineRunDetailsPage.
  • Adds name and limit options to UseTaskRunsOptions and usePipelineRuns so consumers can fetch a single resource by name without needing a dedicated wrapper hook.
  • Fixes a stale-value bug in useRuns where the return useMemo had an incomplete dependency array — it referenced loaded/error instead of effectiveLoaded/effectiveError and was missing shouldUseMultiCluster, mcPendingAdmission, and mcProxyUnavailable.
  • Rectifies the array de-structuring in PipelineRunVisualization

Details

Change Impact
useTaskRuns2 removed Was a pass-through to useRuns<TaskRunKind>. useTaskRuns now calls useRuns directly.
useTaskRun removed TaskRunDetailsPage now calls useTaskRuns with { name, limit: 1 } and picks [0]. Error-suppression logic in the old wrapper was unused by the consumer.
usePipelineRun removed PipelineRunDetailsPage now calls usePipelineRuns with { name, limit: 1 } and picks [0]. Same — error-suppression was unused.
useMemo removed from useRuns return Fixes stale multi-cluster state (mcPendingAdmission, mcProxyUnavailable, effectiveLoaded, effectiveError were missing from the dep array).

Screen recording

PipelineRun and TaskRun Details Page

PipelineDetailsClusterWorking.mov
PipelineRunRunningWorking.mov

The logs do not show up in this one as the loki setup is not done in this cluster

PipelineRunArchivedWorking.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
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

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

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]

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

@openshift-ci-robot
Copy link
Copy Markdown
Collaborator

openshift-ci-robot commented Apr 16, 2026

@anwesha-palit-redhat: This pull request references SRVKP-11395 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:

Summary

No logical or functional changes are added in this PR

  • Removes three thin wrapper hooks (useTaskRuns2, useTaskRun, usePipelineRun) that only delegated to useRuns, inlining their logic at the call sites in TaskRunDetailsPage and PipelineRunDetailsPage.
  • Adds name and limit options to UseTaskRunsOptions and usePipelineRuns so consumers can fetch a single resource by name without needing a dedicated wrapper hook.
  • Removed the useMemo in useRuns
  • Rectifies the array de-structuring in PipelineRunVisualization

Details

Change Impact
useTaskRuns2 removed Was a pass-through to useRuns<TaskRunKind>. useTaskRuns now calls useRuns directly.
useTaskRun removed TaskRunDetailsPage now calls useTaskRuns with { name, limit: 1 } and picks [0]. Error-suppression logic in the old wrapper was unused by the consumer.
usePipelineRun removed PipelineRunDetailsPage now calls usePipelineRuns with { name, limit: 1 } and picks [0]. Same — error-suppression was unused.
useMemo removed from useRuns return Fixes stale multi-cluster state (mcPendingAdmission, mcProxyUnavailable, effectiveLoaded, effectiveError were missing from the dep array).

Screen recording

PipelineRun and TaskRun Details Page

PipelineDetailsClusterWorking.mov
PipelineRunRunningWorking.mov

The logs do not show up in this one as the loki setup is not done in this cluster

PipelineRunArchivedWorking.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-robot
Copy link
Copy Markdown
Collaborator

openshift-ci-robot commented Apr 16, 2026

@anwesha-palit-redhat: This pull request references SRVKP-11395 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:

Summary

No logical or functional changes are added in this PR

  • Removes three thin wrapper hooks (useTaskRuns2, useTaskRun, usePipelineRun) that only delegated to useRuns, inlining their logic at the call sites in TaskRunDetailsPage and PipelineRunDetailsPage.
  • Adds name and limit options to UseTaskRunsOptions and usePipelineRuns so consumers can fetch a single resource by name without needing a dedicated wrapper hook.
  • Removed the useMemo in useRuns
  • Rectifies the array de-structuring in PipelineRunVisualization

Details

Change Impact
useTaskRuns2 removed Was a pass-through to useRuns<TaskRunKind>. useTaskRuns now calls useRuns directly.
useTaskRun removed TaskRunDetailsPage now calls useTaskRuns with { name, limit: 1 } and picks [0]. Error-suppression logic in the old wrapper was unused by the consumer.
usePipelineRun removed PipelineRunDetailsPage now calls usePipelineRuns with { name, limit: 1 } and picks [0]. Same — error-suppression was unused.
useMemo removed from useRuns return Fixes stale multi-cluster state (mcPendingAdmission, mcProxyUnavailable, effectiveLoaded, effectiveError were missing from the dep array).

Screen recording

PipelineRun and TaskRun Details Page

PipelineDetailsClusterWorking.mov
PipelineRunRunningWorking.mov

The logs do not show up in this one as the loki setup is not done in this cluster

PipelineRunArchivedWorking.mov

Pipeline Overview Page navigation

OverviewPageNavigation.mov

Pipeline Metrics Page navigation with OSP 1.21.1 and OCP 4.21

PipelineMetricsNavigationOSP1.21.1OCP4.21.mov

Pipeline Metrics Page navigation with latest changes and OCP 4.22

PipelineMetrics_OSP_master_OCP_4.22.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.

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

Labels

approved Label for Approved PRs jira/valid-reference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants