SRVKP-9437: fix - resolve pending approval tasks displaying as Unknown#1059
SRVKP-9437: fix - resolve pending approval tasks displaying as Unknown#1059adityavshinde wants to merge 2 commits into
Conversation
|
@adityavshinde: This pull request references SRVKP-9437 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 bug to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: adityavshinde The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: Aditya Shinde <adishind@redhat.com>
f53e877 to
aff7dee
Compare
Summary
In the OpenShift Pipelines Approvals tab, newly created manual approval tasks for a PipelineRun are shown with a status of “Unknown” even though they are pending. Because the Approvals tab filters by "Pending" by default, these tasks do not match the filter criteria and are completely hidden from the user, making the page look empty.
Root Cause
The bug resides in the UI's “getApprovalStatus” function (console-plugin/src/components/utils/pipeline-approval-utils.ts).
The function currently enforces a strict logic gate: it only checks if an approval is "pending" if the associated PipelineRun is currently in a Running state. If the PipelineRun is not running ( i.e. status of the PipelineRun is not yet fetched by the UI ) then the function skips the pending status check entirely.
Instead of evaluating the task's actual state, it hits the bottom of the function and returns an unconditional default fallthrough of ApprovalStatus.Unknown.
Changes
Right before the final fallthrough to Unknown, the function should check if the task's core state is ApproverStatusResponse.Pending and return ApprovalStatus.RequestSent (which renders as "Pending" in the UI).
Screen Recordings
Before fix
MAG-CASE-1.mp4
MAG-CASE-3.mp4
MAG-CASE-4.mp4
After fix combined
MAG-After-fix.mp4