rusackas opened a new pull request, #41969:
URL: https://github.com/apache/superset/pull/41969

   ### SUMMARY
   
   Regression test for #31466 ("More than 100 roles will cause RLS role 
dropdown and API not showing all roles").
   
   The original bug: the RLS role picker was served by `GET 
/api/v1/rowlevelsecurity/related/roles`, which had no entry in 
`related_field_filters`. The search `filter` term was therefore silently 
ignored, so with more than 100 roles (the default page size) any role past the 
first page was unreachable — you could neither see nor select it.
   
   Since then, the RLS subject/role picker was refactored (#38831, #41897): 
roles are now modeled as `Subject` rows and served by `GET 
/api/v1/rowlevelsecurity/related/subjects`, whose `FilterRelatedSubjects` 
applies an `ILIKE` on the subject label. That makes any role findable by name 
regardless of how many roles exist, which resolves the reported bug.
   
   This is a **test-only** change. It adds 
`test_rls_subjects_related_api_honors_filter_31466` to the existing 
`TestRowLevelSecurityWithRelatedAPI` class. The test creates a role with a 
unique marker label, syncs it to a ROLE-type subject, enables ROLE subjects in 
the RLS picker (`SUBJECTS_RELATED_TYPES_RLS`), then asserts the role is 
findable via the search term **and** that the filter narrows the result to 
matching subjects only (i.e. it is no longer ignored). No production code is 
touched.
   
   ### How to interpret CI
   
   - **Green** (expected): the endpoint honors the search filter on current 
master, confirming #31466 is fixed by the Subject refactor. The test stands as 
a regression guard against reintroducing the silent-cap behavior.
   - **Red**: the search filter is being ignored again (non-matching roles leak 
through, or the target role is unreachable) — the #31466 bug would have 
regressed.
   
   ### TESTING INSTRUCTIONS
   
   ```
   pytest 
"tests/integration_tests/security/row_level_security_tests.py::TestRowLevelSecurityWithRelatedAPI::test_rls_subjects_related_api_honors_filter_31466"
 -v
   ```
   
   Passes locally on master.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue: Closes #31466
   - [x] Required feature flags: N/A
   - [x] Changes UI: no
   - [x] Includes DB Migration: no
   - [x] Introduces new feature or API: no (test-only)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to