Bug 2078565

Summary: Pipeline details page should not show Metrics tab for users without permissions to fetch data points
Product: OpenShift Container Platform Reporter: Christoph Jerolimov <cjerolim>
Component: Dev ConsoleAssignee: Karthik Jeeyar <kjeeyar>
Status: CLOSED NOTABUG QA Contact: spathak <spathak>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.11CC: kjeeyar, nmukherj
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-24 06:03:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
missing-data-points.png none

Description Christoph Jerolimov 2022-04-25 15:58:29 UTC
Description of problem:
The Pipeline details page shows a Metrics tab for the latest PipelineRuns to show their success ratio and other stats.

To see the charts the user needs view access to the openshift-pipeline namespace.

This is a follow up on https://bugzilla.redhat.com/show_bug.cgi?id=2041769


Version-Release number of selected component (if applicable):
4.9+

How reproducible:
Always as a user with limited access

Steps to Reproduce:
1. Add OpenShift Pipelines operator (tested with 1.7)
2. Switch to a user with limited access (you should not see ANY namespace)
3. Create a new namespace
4. Import an application from git and enable the Pipelines checkbox
5. Let the PipelineRun finish at least one time (success or failure state)
6. Switch to Pipeline detail page.

Actual results:
It shows a "Metrics" tab with four cards that show "No datapoint found."

Expected results:
It should check the required permission and should not show the "Metrics" tab if it couldn't show the stats/data points.

Additional info:
None

Comment 1 Christoph Jerolimov 2022-04-25 16:00:17 UTC
Created attachment 1874853 [details]
missing-data-points.png

Comment 3 Karthik Jeeyar 2022-05-24 06:03:17 UTC
A Fix is provided by the pipelines operator team in this PR https://github.com/tektoncd/operator/pull/796 and this will be backported to 4.10 and 4.9 respective operators, so we no longer need to hide the metrics tab.I am closing this ticket, let me know if there are any questions.