Skip to content

OCPBUGS-115833: Show CPU/Memory metrics for non-admin users on Projects page - #17132

Open
redhat-chai-bot wants to merge 2 commits into
openshift:release-4.22from
redhat-chai-bot:OCPBUGS-115833
Open

OCPBUGS-115833: Show CPU/Memory metrics for non-admin users on Projects page#17132
redhat-chai-bot wants to merge 2 commits into
openshift:release-4.22from
redhat-chai-bot:OCPBUGS-115833

Conversation

@redhat-chai-bot

Copy link
Copy Markdown

Analysis / Root cause

Non-admin users cannot list namespaces cluster-wide, so the existing cluster-wide Prometheus metrics request fails for them. The Projects page also gated the metrics columns on that permission.

Solution description

  • Query the Prometheus tenancy endpoint per namespace for non-admin users.
  • Show the metrics columns whenever Prometheus is available.
  • Validate namespace names before constructing query URLs.

Validation

  • yarn eslint public/components/namespace.jsx passes.
  • yarn test namespace.spec.tsx encounters the same pre-existing schema-loading failure on both the base and feature branches; the test does not cover the changed metrics logic.

Jira issue OCPBUGS-115833


AI-generated. Review for accuracy.

@stefanonardo requested in Slack thread

redhat-chai-bot and others added 2 commits September 2, 2026 11:49
…ts page

Use the Prometheus tenancy endpoint for non-admin users so the Projects
list page shows CPU and Memory columns regardless of cluster-level
namespace permissions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap long encodeURIComponent call to satisfy prettier line-length rule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. label Sep 2, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Sep 2, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-115833, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-112307 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-112307 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Analysis / Root cause

Non-admin users cannot list namespaces cluster-wide, so the existing cluster-wide Prometheus metrics request fails for them. The Projects page also gated the metrics columns on that permission.

Solution description

  • Query the Prometheus tenancy endpoint per namespace for non-admin users.
  • Show the metrics columns whenever Prometheus is available.
  • Validate namespace names before constructing query URLs.

Validation

  • yarn eslint public/components/namespace.jsx passes.
  • yarn test namespace.spec.tsx encounters the same pre-existing schema-loading failure on both the base and feature branches; the test does not cover the changed metrics logic.

Jira issue OCPBUGS-115833


AI-generated. Review for accuracy.

@stefanonardo requested in Slack thread

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 component/core Related to console core functionality label Sep 2, 2026
@stefanonardo

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 2, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console

@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: redhat-chai-bot, stefanonardo
Once this PR has been reviewed and has the lgtm label, please assign jhadvig for approval. For more information see the Code Review Process.

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

Details Needs approval from an approver in each of these files:

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

1 similar comment
@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: redhat-chai-bot, stefanonardo
Once this PR has been reviewed and has the lgtm label, please assign jhadvig for approval. For more information see the Code Review Process.

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

Details Needs approval from an approver in each of these files:

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 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/backend da5eaa4 link true /test backend

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

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

Labels

component/core Related to console core functionality jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants