Skip to content

OCPBUGS-113611: Preserve sort params after project delete - #17090

Closed
stefanonardo wants to merge 1 commit into
openshift:mainfrom
stefanonardo:OCPBUGS-113611
Closed

stefanonardo wants to merge 1 commit into
openshift:mainfrom
stefanonardo:OCPBUGS-113611

Conversation

@stefanonardo

@stefanonardo stefanonardo commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Analysis / Root cause: After a successful delete, the modal navigated to `/k8s/cluster/${kind.plural}` without search params, stripping `sortBy`/`orderBy` and causing ConsoleDataView to reset sort to the default column.

Solution description: Append `window.location.search` to the navigate call so sort (and page/perPage) params are preserved.

Screenshots / screen recording:

Test setup: Go to Home → Projects, sort by Requester, delete a project via the kebab menu.

Test cases:

  • Sort by Requester, delete a project → sort remains on Requester
  • No active sort params → navigate URL unchanged (empty search appended)

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info: Regression introduced in 4.21 with the ConsoleDataView migration (CONSOLE-4719).

Summary by CodeRabbit

  • Bug Fixes

    • Preserved existing URL search parameters after successfully deleting a namespace.
  • Tests

    • Added coverage to verify navigation retains URL query parameters after namespace deletion.

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. 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 Aug 25, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

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

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

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

Details

In response to this:

Analysis / Root cause: After a successful delete, the modal navigated to `/k8s/cluster/${kind.plural}` without search params, stripping `sortBy`/`orderBy` and causing ConsoleDataView to reset sort to the default column.

Solution description: Append `window.location.search` to the navigate call so sort (and page/perPage) params are preserved.

Screenshots / screen recording:

Test setup: Go to Home → Projects, sort by Requester, delete a project via the kebab menu.

Test cases:

  • Sort by Requester, delete a project → sort remains on Requester
  • No active sort params → navigate URL unchanged (empty search appended)

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info: Regression introduced in 4.21 with the ConsoleDataView migration (CONSOLE-4719).

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

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9440d695-656e-4934-baa4-4eb85641fd1d

📥 Commits

Reviewing files that changed from the base of the PR and between 6fcb2dd and 96a878c.

📒 Files selected for processing (2)
  • frontend/public/components/modals/__tests__/delete-namespace-modal.spec.tsx
  • frontend/public/components/modals/delete-namespace-modal.tsx

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The namespace deletion modal is exported for testing. After successful deletion, navigation preserves the current URL query parameters. A test verifies preservation of sortBy and orderBy.

Changes

Namespace deletion navigation

Layer / File(s) Summary
Preserve query parameters after deletion
frontend/public/components/modals/delete-namespace-modal.tsx, frontend/public/components/modals/__tests__/delete-namespace-modal.spec.tsx
DeleteNamespaceModal is exported. Post-deletion navigation appends window.location.search. The test verifies that sortBy and orderBy remain in the destination URL.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 96a87

The change preserves sorting and pagination parameters when returning to the project list after deletion. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: logonoff, rhamilto

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Jira issue and the primary change: preserving sort parameters after project deletion.
Description check ✅ Passed The description includes the root cause, solution, test setup, test cases, browser conformance section, and regression context. The screenshots section remains a placeholder, browser checks are unmark…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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 PASS: The pull request adds a Jest test, not a Ginkgo test. Its describe and it titles are static strings. The generated-looking resource name appears only in test setup and assertions, not in a t…
Test Structure And Quality ✅ Passed PASS — The custom check is scoped to Ginkgo test code, but this pull request adds a Jest/React Testing Library .spec.tsx test. The committed diff contains describe, it, beforeEach, and `waitFo…
Microshift Test Compatibility ✅ Passed The check is not applicable. The pull request adds a TypeScript React Testing Library/Jest test in delete-namespace-modal.spec.tsx, using lowercase describe and it, not new Ginkgo e2e tests. The…
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS: The pull request adds a Jest/React Testing Library frontend unit test, not a Ginkgo end-to-end test. The changed files contain no Ginkgo tests or multi-node/HA assumptions, so the SNO compatibil…
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The pull request changes only a frontend modal and its test. The diff adds a navigation query string and exports DeleteNamespaceModal; it adds no deployment manifests, operator code, controlle…
Ote Binary Stdout Contract ✅ Passed PASS: The pull request changes only two frontend TypeScript/TSX files. It adds a React test and changes browser navigation in DeleteNamespaceModal. It adds no Go files, OTE binaries, suite setup, or…
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The pull request adds one Jest/React Testing Library unit test, not a Ginkgo e2e test. The test uses window.history.pushState and a local mock for useNavigate; it contains no IPv4 addresses,…
No-Weak-Crypto ✅ Passed PASS: The pull request changes only DeleteNamespaceModal export/navigation behavior and adds a Jest test. The added code contains no MD5, SHA1, DES, 3DES, RC4, Blowfish, ECB, custom cryptography, or…
Container-Privileges ✅ Passed PASS: The pull request changes only a TypeScript modal and its test. The parent-to-HEAD diff contains no container or Kubernetes manifest changes and no privilege-related settings such as privileged, …
No-Sensitive-Data-In-Logs ✅ Passed No logging was introduced by this pull request. The exact diff adds a test and appends window.location.search to a navigate URL; it contains no console, logger, print, or trace calls. The URL ch…
Full details: Description check

Explanation

The description includes the root cause, solution, test setup, test cases, browser conformance section, and regression context. The screenshots section remains a placeholder, browser checks are unmarked, and reviewer assignments are not included, but the core information is complete.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Full details: Stable And Deterministic Test Names

Explanation

PASS: The pull request adds a Jest test, not a Ginkgo test. Its describe and it titles are static strings. The generated-looking resource name appears only in test setup and assertions, not in a test title. No stated failure condition is present.

Full details: Test Structure And Quality

Explanation

PASS — The custom check is scoped to Ginkgo test code, but this pull request adds a Jest/React Testing Library .spec.tsx test. The committed diff contains describe, it, beforeEach, and waitFor, not Ginkgo It, BeforeEach, AfterEach, Eventually, or Consistently. The test mocks k8sKill and performs no cluster resource operations. Therefore, none of the stated Ginkgo-specific failure conditions apply.

Full details: Microshift Test Compatibility

Explanation

The check is not applicable. The pull request adds a TypeScript React Testing Library/Jest test in delete-namespace-modal.spec.tsx, using lowercase describe and it, not new Ginkgo e2e tests. The changed test contains no MicroShift checks, OpenShift API references, unsupported namespaces, or infrastructure assumptions. The Project value is only mocked component data and does not make this a Ginkgo test.

Full details: Single Node Openshift (Sno) Test Compatibility

Explanation

PASS: The pull request adds a Jest/React Testing Library frontend unit test, not a Ginkgo end-to-end test. The changed files contain no Ginkgo tests or multi-node/HA assumptions, so the SNO compatibility check is not applicable.

Full details: Topology-Aware Scheduling Compatibility

Explanation

PASS: The pull request changes only a frontend modal and its test. The diff adds a navigation query string and exports DeleteNamespaceModal; it adds no deployment manifests, operator code, controllers, replica settings, affinity, topology spread, node selectors, tolerations, or PDBs. The topology-aware scheduling check is therefore not applicable.

Full details: Ote Binary Stdout Contract

Explanation

PASS: The pull request changes only two frontend TypeScript/TSX files. It adds a React test and changes browser navigation in DeleteNamespaceModal. It adds no Go files, OTE binaries, suite setup, or process-level stdout writes. The OTE Binary Stdout Contract check is not applicable.

Full details: Ipv6 And Disconnected Network Test Compatibility

Explanation

PASS: The pull request adds one Jest/React Testing Library unit test, not a Ginkgo e2e test. The test uses window.history.pushState and a local mock for useNavigate; it contains no IPv4 addresses, IP parsing, network objects, external hosts, URLs to public services, or image pulls. The production change only appends window.location.search to a client-side route.

Full details: No-Weak-Crypto

Explanation

PASS: The pull request changes only DeleteNamespaceModal export/navigation behavior and adds a Jest test. The added code contains no MD5, SHA1, DES, 3DES, RC4, Blowfish, ECB, custom cryptography, or secret/token comparison. The navigation change only appends window.location.search.

Full details: Container-Privileges

Explanation

PASS: The pull request changes only a TypeScript modal and its test. The parent-to-HEAD diff contains no container or Kubernetes manifest changes and no privilege-related settings such as privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation.

Full details: No-Sensitive-Data-In-Logs

Explanation

No logging was introduced by this pull request. The exact diff adds a test and appends window.location.search to a navigate URL; it contains no console, logger, print, or trace calls. The URL change performs navigation only and does not log passwords, tokens, API keys, PII, session IDs, hostnames, or customer data.

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

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

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@stefanonardo: This pull request references Jira Issue OCPBUGS-113611, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Analysis / Root cause: After a successful delete, the modal navigated to `/k8s/cluster/${kind.plural}` without search params, stripping `sortBy`/`orderBy` and causing ConsoleDataView to reset sort to the default column.

Solution description: Append `window.location.search` to the navigate call so sort (and page/perPage) params are preserved.

Screenshots / screen recording:

Test setup: Go to Home → Projects, sort by Requester, delete a project via the kebab menu.

Test cases:

  • Sort by Requester, delete a project → sort remains on Requester
  • No active sort params → navigate URL unchanged (empty search appended)

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info: Regression introduced in 4.21 with the ConsoleDataView migration (CONSOLE-4719).

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 Leo6Leo and rhamilto August 25, 2026 13:28
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Aug 25, 2026
@openshift-ci

openshift-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: stefanonardo
Once this PR has been reviewed and has the lgtm label, please assign vikram-raj 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

@stefanonardo

stefanonardo commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor Author

duplicate #17088

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@stefanonardo: This pull request references Jira Issue OCPBUGS-113611. The bug has been updated to no longer refer to the pull request using the external bug tracker.

Details

In response to this:

Analysis / Root cause: After a successful delete, the modal navigated to `/k8s/cluster/${kind.plural}` without search params, stripping `sortBy`/`orderBy` and causing ConsoleDataView to reset sort to the default column.

Solution description: Append `window.location.search` to the navigate call so sort (and page/perPage) params are preserved.

Screenshots / screen recording:

Test setup: Go to Home → Projects, sort by Requester, delete a project via the kebab menu.

Test cases:

  • Sort by Requester, delete a project → sort remains on Requester
  • No active sort params → navigate URL unchanged (empty search appended)

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info: Regression introduced in 4.21 with the ConsoleDataView migration (CONSOLE-4719).

Summary by CodeRabbit

  • Bug Fixes

  • Preserved existing URL search parameters after successfully deleting a namespace.

  • Tests

  • Added coverage to verify navigation retains URL query parameters after namespace deletion.

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.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants