Skip to content

ROX-37291: Delete ROX_LABEL_BASED_POLICY_SCOPING in ui - #23192

Open
pedrottimark wants to merge 1 commit into
masterfrom
ROX-37291-delete-ROX_LABEL_BASED_POLICY_SCOPING
Open

pedrottimark wants to merge 1 commit into
masterfrom
ROX-37291-delete-ROX_LABEL_BASED_POLICY_SCOPING

Conversation

@pedrottimark

@pedrottimark pedrottimark commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Review: Hide space because of indentation changes

Situation

Feature flag was enabled for 4.11 release on 2026-04-22 in #19987

https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_security_for_kubernetes/4.11/html/release_notes/release-notes-411#policy-scope-cluster-namespace-labels_release-notes-411

It is hard to see how we could hide policy configuration in UI after it has been released, and therefore used in security policies.

Analysis

Find in Files 'ROX_LABEL_BASED_POLICY_SCOPING'

  • no results in: ui/apps/platform/cypress
  • 3 results in 2 files: ui/apps/platform/src

Although this contribution will cause mere conflict with contribution to delete ROX_LEGACY_SCANNER' that might be a feature instead of a bug.

While we wait (out of an abundance of caution) to merge the larger contribution, rebase and rerun tests will give even more confidence when its time arrives.

Procedure

https://github.com/stackrox/stackrox/tree/master/ui/apps/platform#delete-a-feature-flag-from-frontend-code

Colleagues can delete from central code at their pace.

User-facing documentation

  • CHANGELOG.md update is not needed
  • documentation PR is not needed

Testing and quality

  • the change is production ready: the change is GA
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  1. npm run tsc in ui/apps/platform folder.
  2. npm run lint in ui/apps/platform folder.
  3. npm run start in ui/apps/platform folder with staging demo as central.

Manual testing

  1. Visit /main/policy-management/policies/?action=create and advance to Resources step

    Card for Inclusion and Exclusion has similar format but different options

    With and without isFeatureFlagEnabled('ROX_LABEL_BASED_POLICY_SCOPING')

    Click Add inclusion and see presence of By label for Cluster amd Namespace
    Inclusion

    Click Add exclusion and see absence of By label for Cluster and Namespace
    Exclusion

@pedrottimark
pedrottimark requested a review from bradr5 October 1, 2026 16:27
@pedrottimark
pedrottimark requested a review from a team as a code owner October 1, 2026 16:27
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: f57e3800-8fda-4d92-81d2-6e3fc3e7cb59

📥 Commits

Reviewing files that changed from the base of the PR and between e2079d0 and f0f17e1.

📒 Files selected for processing (3)
  • ui/apps/platform/src/Containers/Policies/Wizard/Step4/PolicyScopeCardLegacy.tsx
  • ui/apps/platform/src/Containers/Policies/Wizard/Step4/PolicyScopeForm.tsx
  • ui/apps/platform/src/types/featureFlag.ts
💤 Files with no reviewable changes (2)
  • ui/apps/platform/src/types/featureFlag.ts
  • ui/apps/platform/src/Containers/Policies/Wizard/Step4/PolicyScopeCardLegacy.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Policy Scoping
    • Policy setup now consistently uses the current inclusion and exclusion forms instead of the legacy scope interface. Scope configuration remains available through the current forms.

Walkthrough

The policy scope form now always renders the current inclusion and exclusion cards. The legacy card and its feature flag are removed.

Changes

Policy scope card selection

Layer / File(s) Summary
Use current scope cards
ui/apps/platform/src/Containers/Policies/Wizard/Step4/PolicyScopeCardLegacy.tsx, ui/apps/platform/src/Containers/Policies/Wizard/Step4/PolicyScopeForm.tsx, ui/apps/platform/src/types/featureFlag.ts
The legacy scope card and feature-flag selection are removed. Inclusion and exclusion entries always render InclusionScopeCard and ExclusionScopeCard. The removed flag is no longer part of FeatureFlagEnvVar.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to f0f17

The change consistently exposes the released policy scope cards. No concrete merge-blocking regression was identified; disabling the backend flag would still reject label-based inclusions, consistent with the intentional frontend removal tradeoff.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the removal of ROX_LABEL_BASED_POLICY_SCOPING from the UI and matches the main changes.
Description check ✅ Passed The description follows the required template, explains the change, addresses documentation, states production readiness, records CI inspection, and provides static and manual validation steps. The un…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.92%. Comparing base (e2079d0) to head (f0f17e1).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #23192      +/-   ##
==========================================
- Coverage   51.96%   51.92%   -0.04%     
==========================================
  Files        2904     2904              
  Lines      183013   183013              
==========================================
- Hits        95099    95035      -64     
- Misses      79595    79639      +44     
- Partials     8319     8339      +20     
Flag Coverage Δ
go-unit-tests 51.92% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit f0f17e1. To use with deploy scripts:

export MAIN_IMAGE_TAG=5.1.x-141-gf0f17e13a9

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant