Skip to content

test(rls): assert dataset search returns all mask matches (#29707)#41968

Merged
hainenber merged 2 commits into
masterfrom
tdd/issue-29707-rls-dataset-search
Jul 12, 2026
Merged

test(rls): assert dataset search returns all mask matches (#29707)#41968
hainenber merged 2 commits into
masterfrom
tdd/issue-29707-rls-dataset-search

Conversation

@rusackas

Copy link
Copy Markdown
Member

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_names and birth_france_by_region
both exist).

The RLS dataset selector is backed by the GET /api/v1/rowlevelsecurity/related/tables
endpoint, whose search is applied by FilterRelatedTables
(SqlaTable.table_name.ilike("%<mask>%")). This PR pins that backend
behavior: it creates two datasets whose names both contain the mask,
searches for the mask, and asserts the endpoint returns every matching
dataset (and that count does not under-report them).

No product code is changed — this is a characterization/regression test to
localize the reported bug.

How to interpret CI

  • Green (as observed locally): the backend related/tables search-by-mask
    correctly 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
    AsyncSelect in RowLevelSecurityModal (the reporter's own note — "scroll
    the list to the bottom, then the search works" — is consistent with a
    client-side option-caching/pagination issue rather than a server filter).
  • Red: the endpoint would be dropping or truncating masked matches,
    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

pytest tests/integration_tests/security/row_level_security_tests.py::TestRowLevelSecurityWithRelatedAPI::test_rls_tables_related_api_returns_all_masked_matches -v

ADDITIONAL INFORMATION

  • Has associated issue: Closes RLS form does not show all available datasets when searching by mask #29707
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

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>
@dosubot dosubot Bot added api Related to the REST API authentication:row-level-security Related to Row Level Security labels Jul 11, 2026
@bito-code-review

bito-code-review Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #07770f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 915d323..915d323
    • tests/integration_tests/security/row_level_security_tests.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread tests/integration_tests/security/row_level_security_tests.py
@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged issue is correct. The new test method test_rls_tables_related_api_returns_all_masked_matches lacks a return type annotation, which is required by the project's development standards. You can resolve this by adding -> None to the method signature.

    @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 must

I 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

@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 must

Comment thread tests/integration_tests/security/row_level_security_tests.py Outdated
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.77%. Comparing base (df209ce) to head (17b910d).
⚠️ Report is 2 commits behind head on master.

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     
Flag Coverage Δ
hive 39.07% <ø> (ø)
mysql 57.98% <ø> (ø)
postgres 58.04% <ø> (-0.01%) ⬇️
presto 41.06% <ø> (ø)
python 59.42% <ø> (-0.01%) ⬇️
sqlite 57.65% <ø> (ø)
unit 100.00% <ø> (ø)

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…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>
@github-actions github-actions Bot removed the api Related to the REST API label Jul 11, 2026
@bito-code-review

bito-code-review Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #eb4f7f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 915d323..17b910d
    • tests/integration_tests/security/row_level_security_tests.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas rusackas requested a review from eschutho July 12, 2026 00:24
@hainenber hainenber merged commit 958d1ab into master Jul 12, 2026
59 checks passed
@hainenber hainenber deleted the tdd/issue-29707-rls-dataset-search branch July 12, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

authentication:row-level-security Related to Row Level Security size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RLS form does not show all available datasets when searching by mask

3 participants