Skip to content

ACM-39807: [release-2.17] Trim whitespace when splitting security-group annotations - #6641

Merged
openshift-merge-bot[bot] merged 2 commits into
stolostron:release-2.17from
openshift-cherrypick-robot:cherry-pick-6535-to-release-2.17
Aug 4, 2026
Merged

ACM-39807: [release-2.17] Trim whitespace when splitting security-group annotations#6641
openshift-merge-bot[bot] merged 2 commits into
stolostron:release-2.17from
openshift-cherrypick-robot:cherry-pick-6535-to-release-2.17

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

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.

🗂️ Base branches to auto review (1)
  • main

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 03ccc2e9-3afb-4102-bea9-7701f441d943

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.

@Randy424 Randy424 changed the title [release-2.17] Trim whitespace when splitting security-group annotations ACM-39807: [release-2.17] Trim whitespace when splitting security-group annotations Aug 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@Randy424

Randy424 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Tested locally with success.
"NIST SP 800-53" has been consolidated to one row in Governance overview "Standards" card.
Screenshot 2026-08-04 at 4 20 48 PM
Screenshot 2026-08-04 at 4 20 41 PM

@Randy424 Randy424 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@openshift-ci openshift-ci Bot added the lgtm label Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: openshift-cherrypick-robot, Randy424

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:

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 approved label Aug 4, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit d6d1dec into stolostron:release-2.17 Aug 4, 2026
12 checks passed
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