Skip to content

OU-1396: fix: use replace to set variables to avoid navigation trap#1013

Open
jgbernalp wants to merge 1 commit into
openshift:mainfrom
jgbernalp:fix-inspect-navigation
Open

OU-1396: fix: use replace to set variables to avoid navigation trap#1013
jgbernalp wants to merge 1 commit into
openshift:mainfrom
jgbernalp:fix-inspect-navigation

Conversation

@jgbernalp

@jgbernalp jgbernalp commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This PR sets the navigation to replace when setting params from the query browser (metrics view). This prevents the multiple redirections that cause a user to be "trapped" in this view, for example when coming from the dashboards inspect.

Summary by CodeRabbit

  • Bug Fixes
    • Updated metric page URL parameter changes to replace the current browser history entry instead of adding a new one, making navigation smoother and reducing back-button clutter.

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 24, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 24, 2026

Copy link
Copy Markdown

@jgbernalp: This pull request references OU-1396 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.

Details

In response to this:

This PR sets the navigation to replace when setting params from the query browser (metrics view). This prevents the multiple redirections that cause a user to be "trapped" in this view, for example when coming from the dashboards inspect.

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 PeterYurkovich and zhuje June 24, 2026 16:39
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e48a631c-700b-4fec-bf1b-778e2b6482a3

📥 Commits

Reviewing files that changed from the base of the PR and between eaf3956 and 897b167.

📒 Files selected for processing (1)
  • web/src/components/MetricsPage.tsx

Walkthrough

In QueryBrowserWrapper inside MetricsPage.tsx, the setQueryParams call that syncs URL query parameters when graph queries change is updated to pass { replace: true }, switching the browser history behavior from push to replace for those parameter updates.

Changes

URL History Behavior in QueryBrowserWrapper

Layer / File(s) Summary
Switch setQueryParams to replace mode
web/src/components/MetricsPage.tsx
The setQueryParams(newParams) call in the URL-sync effect is changed to setQueryParams(newParams, { replace: true }), so query parameter updates no longer push a new browser history entry.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: using replace when setting variables to prevent navigation traps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR only changes query-param replace behavior in MetricsPage.tsx; no test titles were added or modified.
Test Structure And Quality ✅ Passed Not applicable: the PR only changes a TypeScript metrics component; no Ginkgo tests or cluster-interaction test code are touched.
Microshift Test Compatibility ✅ Passed PASS: The PR only changes MetricsPage.tsx UI logic; no Ginkgo test blocks or MicroShift-incompatible OpenShift APIs were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes MetricsPage.tsx navigation behavior, so SNO compatibility is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Only MetricsPage.tsx changed, updating URL query params to replace history; no deployment, operator, controller, affinity, or topology scheduling code was added.
Ote Binary Stdout Contract ✅ Passed The PR only changes a URL replace flag in MetricsPage.tsx; no process-level main/suite setup or stdout writes were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR only changes a frontend TSX component; no new Ginkgo e2e tests, IPv4-only assumptions, or external connectivity code were added.
No-Weak-Crypto ✅ Passed Changed code only switches query-param navigation to replace:true; no weak crypto, custom crypto, or secret comparisons appear in the touched file.
Container-Privileges ✅ Passed No privileged container settings found; the PR change is UI-only, and the chart manifests use runAsNonRoot=true with allowPrivilegeEscalation=false.
No-Sensitive-Data-In-Logs ✅ Passed No new logging was added; the PR only switches setQueryParams to replace:true, and existing console.error(err) is pre-existing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@PeterYurkovich

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2026
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, PeterYurkovich

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 [PeterYurkovich,jgbernalp]

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

@etmurasaki

Copy link
Copy Markdown
Contributor

/test e2e-aws-ovn

1 similar comment
@jgbernalp

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn

@PeterYurkovich

Copy link
Copy Markdown
Contributor

/retest all

@PeterYurkovich

Copy link
Copy Markdown
Contributor

/test all

@PeterYurkovich

Copy link
Copy Markdown
Contributor

/retest

@openshift-ci

openshift-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@jgbernalp: The following tests 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/okd-scos-images 897b167 link true /test okd-scos-images
ci/prow/e2e-aws-ovn 897b167 link false /test e2e-aws-ovn

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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.

4 participants