test(rls): assert dataset search returns all mask matches (#29707)#41968
Conversation
Regression coverage for #29707, where the RLS rule form's dataset selector reportedly showed an incomplete list when filtering by a search mask. This exercises the backend related/tables endpoint that feeds the selector, creating two datasets whose names both contain the mask and asserting the masked search returns every match. Closes #29707 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review Agent Run #07770fActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
The flagged issue is correct. The new test method @pytest.mark.usefixtures("load_birth_names_data")
def test_rls_tables_related_api_returns_all_masked_matches(self) -> None:
"""
Regression for #29707: the RLS dataset selector's async search mustI have checked the available PR comments, and there are no other comments to address at this time. Would you like me to implement this change for you? tests/integration_tests/security/row_level_security_tests.py |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41968 +/- ##
==========================================
- Coverage 64.77% 64.77% -0.01%
==========================================
Files 2742 2742
Lines 153316 153316
Branches 35143 35143
==========================================
- Hits 99317 99304 -13
- Misses 52101 52111 +10
- Partials 1898 1901 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…9707) Compare the masked related/tables search results as sorted lists rather than sets so datasets that render the same display name are not collapsed, keeping the multiplicity aligned with the API's row count. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review Agent Run #eb4f7fActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Test-only PR adding regression coverage for #29707, where the Row Level
Security rule form's dataset selector reportedly showed an incomplete list
of datasets when filtering by a search mask (typing "birth" returned an
empty/partial list even though
birth_namesandbirth_france_by_regionboth exist).
The RLS dataset selector is backed by the
GET /api/v1/rowlevelsecurity/related/tablesendpoint, whose search is applied by
FilterRelatedTables(
SqlaTable.table_name.ilike("%<mask>%")). This PR pins that backendbehavior: it creates two datasets whose names both contain the mask,
searches for the mask, and asserts the endpoint returns every matching
dataset (and that
countdoes not under-report them).No product code is changed — this is a characterization/regression test to
localize the reported bug.
How to interpret CI
related/tablessearch-by-maskcorrectly returns all matching datasets and does not truncate them. That
means the incomplete-list behavior in RLS form does not show all available datasets when searching by mask #29707 does not originate in this
backend endpoint/filter, and the remaining suspect is the frontend
AsyncSelectinRowLevelSecurityModal(the reporter's own note — "scrollthe list to the bottom, then the search works" — is consistent with a
client-side option-caching/pagination issue rather than a server filter).
confirming the bug lives in the backend lookup and pointing a fix at
FilterRelatedTables/ the related-field pagination.This test currently passes on
master.TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
🤖 Generated with Claude Code