Skip to content

ACM-39806: [release-2.15] Trim whitespace when splitting security-group annotations - #6643

Open
openshift-cherrypick-robot wants to merge 2 commits into
stolostron:release-2.15from
openshift-cherrypick-robot:cherry-pick-6535-to-release-2.15
Open

ACM-39806: [release-2.15] Trim whitespace when splitting security-group annotations#6643
openshift-cherrypick-robot wants to merge 2 commits into
stolostron:release-2.15from
openshift-cherrypick-robot:cherry-pick-6535-to-release-2.15

Conversation

@openshift-cherrypick-robot

@openshift-cherrypick-robot openshift-cherrypick-robot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Regarding: https://redhat.atlassian.net/browse/ACM-39806
This is an automated cherry-pick of #6535

/assign Randy424

The Governance Overview Standards/Categories/Controls cards, and the
policy drill-down sidebar behind them, group policies by splitting
the policy.open-cluster-management.io/{standards,categories,controls}
annotation on ",". String.split(',') leaves a leading space on every
token after the first (e.g. "A, B".split(',') -> ["A", " B"]), so the
same logical value produces a second, distinct row whenever it isn't
first in a comma-separated list on some policies but is standalone or
first-in-list on others.

Trim each token after splitting in both useSecurityGroupViolations
(Overview.tsx) and the matching filter in
SecurityGroupPolicySummarySidebar.tsx so aggregation and drill-down
filtering key off the same normalized value regardless of annotation
formatting.

Reported in Red Hat case 04500068.

Signed-off-by: Sunny Gupta <sungupta@redhat.com>
The SecurityGroupPolicySummarySidebar drill-down applies the same
comma-split-without-trim fix as useSecurityGroupViolations, but the
existing regression test only exercised the Overview card path,
leaving the sidebar's fixed line uncovered on new code (SonarCloud
flagged 50% coverage on new code, below the 70% gate).

Add a test that renders SecurityGroupPolicySummarySidebar directly
with a policy whose matching standard is not first in its
comma-separated annotation, and asserts the policy appears in the
filtered list. Verified this test fails without the sidebar's
.trim() fix and passes with it.

Signed-off-by: Sunny Gupta <sungupta@redhat.com>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 1455b1a2-7e85-41fe-8dfe-db9b61295cab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: openshift-cherrypick-robot
Once this PR has been reviewed and has the lgtm label, please assign jan-law 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

@Randy424 Randy424 changed the title [release-2.15] Trim whitespace when splitting security-group annotations ACM-39806: [release-2.15] Trim whitespace when splitting security-group annotations Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

@openshift-cherrypick-robot: 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/unit-tests-sonarcloud 6cf8c87 link true /test unit-tests-sonarcloud

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants