Skip to content

OCPBUGS-77113: remove dev to admin links as dev monitoring views are enabled#16163

Open
jgbernalp wants to merge 1 commit intoopenshift:mainfrom
jgbernalp:remove-dev-to-admin-console-monitoring-links
Open

OCPBUGS-77113: remove dev to admin links as dev monitoring views are enabled#16163
jgbernalp wants to merge 1 commit intoopenshift:mainfrom
jgbernalp:remove-dev-to-admin-console-monitoring-links

Conversation

@jgbernalp
Copy link
Contributor

@jgbernalp jgbernalp commented Mar 17, 2026

Summary by CodeRabbit

  • Updates
    • Monitoring dashboard URLs now use path-based routing instead of query parameters.
    • Monitoring access is now controlled by feature flags and user permissions.
    • Added perspective-aware navigation behavior for monitoring views and alerts.
    • The application automatically adjusts your perspective when navigating to specific monitoring dashboards.

@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 Mar 17, 2026
@openshift-ci-robot
Copy link
Contributor

@jgbernalp: This pull request references Jira Issue OCPBUGS-77113, which is valid.

3 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 POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @juzhao

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

Details

In 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.

@openshift-ci openshift-ci bot requested review from jhadvig, juzhao and spadgett March 17, 2026 15:07
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Mar 17, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 17, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jgbernalp
Once this PR has been reviewed and has the lgtm label, please assign vojtechszocs 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 added component/dashboard Related to dashboard component/dev-console Related to dev-console component/shared Related to console-shared labels Mar 17, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

This pull request refactors monitoring URL routing across multiple OpenShift Console components to support perspective-aware navigation. Changes replace query-parameter-based monitoring URLs with path-encoded routes using /dev-monitoring/ns/{namespace}. The useActivePerspective hook is integrated to track the active perspective state, while a new canAccessMonitoring flag gates monitoring access by combining feature flag checks with Prometheus availability. Components now conditionally route to either standard monitoring query-browser or dev-monitoring paths based on perspective state and access permissions. OnClick handlers switch perspective to 'dev' when navigating to dev-monitoring URLs from other perspectives. The PrometheusGraphLinkProps interface is updated to expose the canAccessMonitoring boolean.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

Review ran into problems

🔥 Problems

Linked repositories: Couldn't analyze openshift/console - clone failed: Clone operation failed: Stream setup permanently failed: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@frontend/packages/console-shared/src/components/dashboard/utilization-card/TopConsumerPopover.tsx`:
- Around line 188-191: The monitoringURL construction in TopConsumerPopover
always interpolates the optional prop namespace, causing
/dev-monitoring/ns/undefined when namespace is missing; change the monitoringURL
logic (used with monitoringParams, canAccessMonitoring, activePerspective) to
only include `/ns/${namespace}/metrics` when namespace is truthy and otherwise
fall back to a safe path such as
`/dev-monitoring/metrics?${monitoringParams.toString()}` (or omit the ns segment
entirely), preserving the admin branch for `/monitoring/query-browser?...`.

In `@frontend/public/components/graphs/prometheus-graph.tsx`:
- Line 13: The import in prometheus-graph.tsx currently references the package
internal path '@console/dynamic-plugin-sdk/src'; update the import to use the
package entrypoint '@console/dynamic-plugin-sdk' instead so useActivePerspective
is imported from the public API (replace the import that references '/src' with
the package root import for useActivePerspective).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 31957c53-4854-4931-ba48-795c5962bedc

📥 Commits

Reviewing files that changed from the base of the PR and between 458a8b6 and d166ad1.

📒 Files selected for processing (5)
  • frontend/packages/console-shared/src/components/dashboard/utilization-card/TopConsumerPopover.tsx
  • frontend/packages/dev-console/src/components/monitoring/dashboard/MonitoringDashboardGraph.tsx
  • frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverview.tsx
  • frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverviewAlerts.tsx
  • frontend/public/components/graphs/prometheus-graph.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverview.tsx
  • frontend/packages/dev-console/src/components/monitoring/overview/MonitoringOverviewAlerts.tsx
  • frontend/public/components/graphs/prometheus-graph.tsx
  • frontend/packages/dev-console/src/components/monitoring/dashboard/MonitoringDashboardGraph.tsx
  • frontend/packages/console-shared/src/components/dashboard/utilization-card/TopConsumerPopover.tsx

@jgbernalp jgbernalp force-pushed the remove-dev-to-admin-console-monitoring-links branch 2 times, most recently from c664639 to cbaeefc Compare March 17, 2026 17:20
…enabled

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
@jgbernalp jgbernalp force-pushed the remove-dev-to-admin-console-monitoring-links branch from cbaeefc to d6ef276 Compare March 17, 2026 17:21
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 17, 2026

@jgbernalp: 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/e2e-gcp-console d6ef276 link true /test e2e-gcp-console

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 component/dashboard Related to dashboard component/dev-console Related to dev-console component/shared Related to console-shared 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants