Skip to content

OCPBUGS-69379: Fix RBAC role rules filter input handling#16749

Open
rzhabbarov wants to merge 1 commit into
openshift:mainfrom
rzhabbarov:OCPBUGS-69379-fix-role-rules-filter
Open

OCPBUGS-69379: Fix RBAC role rules filter input handling#16749
rzhabbarov wants to merge 1 commit into
openshift:mainfrom
rzhabbarov:OCPBUGS-69379-fix-role-rules-filter

Conversation

@rzhabbarov

@rzhabbarov rzhabbarov commented Jul 12, 2026

Copy link
Copy Markdown

Analysis / Root cause:
The RBAC Role rules filter handled the TextInput onChange callback incorrectly. PatternFly TextInput passes the input value as the second argument, but the component stored the first argument in state, which is the change event. As a result, the rules filter did not use the entered filter text correctly.

Solution description:
Updated the Role details rules filter handler to read the filter text from the second onChange argument.

Screenshots / screen recording:
before fix:
https://github.com/user-attachments/assets/0a140b95-781d-4779-bcd1-d0c3f6743847
after fix:
https://github.com/user-attachments/assets/8eb4e15d-2828-4009-9286-d6317df42f41

Test setup:
No special setup required.

Test cases:

  1. Enter a resource name, for example pods, in the rules filter input and verify that matching rules remain visible.
  2. Enter a verb, for example get or create, and verify that matching rules remain visible.
  3. Enter a non-matching value and verify that the rules table shows no matching rows.
  4. Clear the filter input and verify that all rules are shown again.

Browser conformance:

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

Additional info:
The component is currently implemented in JSX, which made this callback signature mismatch easy to miss. I kept this PR scoped to the bug fix, but I can follow up with a separate TSX migration if maintainers think it would be useful.

Reviewers and assignees:

Summary by CodeRabbit

  • Bug Fixes
    • Fixed rule filtering so selecting a filter consistently updates the displayed results.

@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/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. labels Jul 12, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@rzhabbarov: This pull request references Jira Issue OCPBUGS-69379, which is invalid:

  • expected the bug to target either version "5.0." or "openshift-5.0.", but it targets "4.22.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

Details

In response to this:

Analysis / Root cause:
The RBAC Role rules filter handled the TextInput onChange callback incorrectly. PatternFly TextInput passes the input value as the second argument, but the component stored the first argument in state, which is the change event. As a result, the rules filter did not use the entered filter text correctly.

Solution description:
Updated the Role details rules filter handler to read the filter text from the second onChange argument.

Screenshots / screen recording:
before fix:
https://github.com/user-attachments/assets/0a140b95-781d-4779-bcd1-d0c3f6743847
after fix:
https://github.com/user-attachments/assets/8eb4e15d-2828-4009-9286-d6317df42f41

Test setup:
No special setup required.

Test cases:

  1. Enter a resource name, for example pods, in the rules filter input and verify that matching rules remain visible.
  2. Enter a verb, for example get or create, and verify that matching rules remain visible.
  3. Enter a non-matching value and verify that the rules table shows no matching rows.
  4. Clear the filter input and verify that all rules are shown again.

Browser conformance:

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

Additional info:
The component is currently implemented in JSX, which made this callback signature mismatch easy to miss. I kept this PR scoped to the bug fix, but I can follow up with a separate TSX migration if maintainers think it would be useful.

Reviewers and assignees:

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-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jul 12, 2026
@openshift-ci openshift-ci Bot requested review from cajieh and rhamilto July 12, 2026 19:11
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Jul 12, 2026
@openshift-ci

openshift-ci Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rzhabbarov
Once this PR has been reviewed and has the lgtm label, please assign spadgett 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 12, 2026
@openshift-ci

openshift-ci Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Hi @rzhabbarov. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai

coderabbitai Bot commented Jul 12, 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: d005ca6e-b1e3-4394-bb45-fd64b4ce0345

📥 Commits

Reviewing files that changed from the base of the PR and between bc58d07 and 2f02b65.

📒 Files selected for processing (1)
  • frontend/public/components/RBAC/role.jsx

Walkthrough

Updated the RBAC role details filter handler to accept TextFilter’s (event, value) callback signature while continuing to update ruleFilter from the selected value.

Changes

RBAC filter alignment

Layer / File(s) Summary
Align filter callback parameters
frontend/public/components/RBAC/role.jsx
Details.changeFilter now accepts the event and filter value arguments, using the value to update ruleFilter.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific, concise, and correctly references the RBAC role rules filter fix with the required Jira prefix.
Description check ✅ Passed The description includes the required root cause, solution, screenshots, test setup, test cases, and extra info sections.
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 Only frontend/public/components/RBAC/role.jsx changed; no Ginkgo test titles or test files were added or modified.
Test Structure And Quality ✅ Passed The diff only changes a React component (role.jsx); no Ginkgo test code or test blocks were added or modified.
Microshift Test Compatibility ✅ Passed Only a frontend RBAC filter handler changed; no Ginkgo e2e tests or MicroShift-unsupported APIs/features were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only updates a JSX filter callback in frontend/public/components/RBAC/role.jsx; no Go/Ginkgo tests or SNO-relevant assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed Only a frontend RBAC filter callback changed; no manifests, controllers, replicas, node selectors, or scheduling constraints were added.
Ote Binary Stdout Contract ✅ Passed Diff only changes the TextFilter callback signature in a React component; no main/init/TestMain/suite setup or stdout writes exist in the touched file.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only a React handler signature changed in frontend/public/components/RBAC/role.jsx; no new Ginkgo e2e tests or network/IP assumptions were added.
No-Weak-Crypto ✅ Passed Only change is a TextFilter callback signature in RBAC role.jsx; no crypto primitives or secret comparisons were added.
Container-Privileges ✅ Passed PR only changes frontend/public/components/RBAC/role.jsx; no container/K8s manifest privilege settings were added or modified.
No-Sensitive-Data-In-Logs ✅ Passed No logging or sensitive-data exposure was added in the RBAC role filter change; the file only updates the onChange handler signature.
✨ 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.

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/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. 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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants