Skip to content

ROX-33406: filter search entities by workflow view#19400

Open
sachaudh wants to merge 4 commits intomasterfrom
ROX-33406
Open

ROX-33406: filter search entities by workflow view#19400
sachaudh wants to merge 4 commits intomasterfrom
ROX-33406

Conversation

@sachaudh
Copy link
Contributor

@sachaudh sachaudh commented Mar 12, 2026

Description

Jira: ROX-33406

The compound search filter on the Violations page showed all 7 entity categories regardless of which workflow view was active. Users saw irrelevant filter options (e.g. Node filters in Applications view).

  • Make searchFilterConfig dynamic based on filteredWorkflowView in ViolationsTableSearchFilter
  • Pass filteredWorkflowView through ViolationsTablePanel to ViolationsTableSearchFilter
  • Clear search filters and reset to page 1 when workflow view changes
  • Alphabetize entity dropdown order (Cluster, Deployment, Namespace, Node, Policy, Policy violation, Resource)
  • Add unit tests for the config mapping function covering all four views

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • 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

  • Unit tests cover getSearchFilterConfig for all four workflow views (Applications, Platform, Node, Full)
  • Verified correct entity filtering: Node view excludes Deployment/Namespace/Resource; Applications/Platform views exclude Node/Resource; Full view includes all
  • Confirmed "Policy" entity is present in all views (required for defaultEntity prop)
  • Lint and type checks pass with no errors

Screenshots

Screenshot 2026-03-12 at 10 57 39 AM Screenshot 2026-03-12 at 10 57 53 AM Screenshot 2026-03-12 at 10 58 02 AM Screenshot 2026-03-12 at 10 58 10 AM

The compound search filter on the Violations page showed all 7 entity
categories regardless of which workflow view was active, causing users
to see irrelevant filter options (e.g. Node filters in Applications
view). The search filter config is now driven by the active
filteredWorkflowView so only contextually relevant entities appear.

Additionally, switching workflow views now clears all active search
filters and resets pagination to page 1, preventing orphaned filters
from invisible entities from affecting query results.

Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Mar 12, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

…ntity list

Full view should show all entities, so use an empty array as a signal
to return allSearchFilterEntities directly. This avoids maintaining a
duplicate list that must be updated whenever new entities are added.

Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 12, 2026

Images are ready for the commit at 928e210.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-313-g928e210a3a.

Rewrite tests to verify the actual filtering behavior rather than
mirroring the config values. Each view test asserts that entities
irrelevant to that workflow context are excluded.

Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
@sachaudh sachaudh marked this pull request as ready for review March 12, 2026 17:57
@sachaudh sachaudh requested a review from a team as a code owner March 12, 2026 17:57
Reorder allSearchFilterEntities so the entity selector dropdown
displays entries alphabetically: Cluster, Deployment, Namespace,
Node, Policy, Policy violation, Resource.

Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.69%. Comparing base (52688db) to head (928e210).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19400   +/-   ##
=======================================
  Coverage   49.68%   49.69%           
=======================================
  Files        2700     2700           
  Lines      203278   203278           
=======================================
+ Hits       100999   101009   +10     
+ Misses      94753    94746    -7     
+ Partials     7526     7523    -3     
Flag Coverage Δ
go-unit-tests 49.69% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

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.

2 participants