Skip to content

fix(dq): #33556 filtered "Select all" on a bundle suite adds only the filtered subset - #33656

Merged
shah-harshit merged 6 commits into
mainfrom
fix/33556-select-all-respects-filter
Sep 25, 2026
Merged

shah-harshit merged 6 commits into
mainfrom
fix/33556-select-all-respects-filter

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part 2 of #33556 — the "Select all selects everything, ignoring the filter" bug.

When adding test cases to a bundle suite, clicking Select all N test cases while a search/filter was applied sent mode=all with no filter context, so the backend added every test case in the system instead of the filtered subset shown in the UI.

This makes bulk all filter-aware end to end.

Schema

  • bundleSuiteBulkAddRequestBulkAll.filter gains the same criteria the UI exposes — q, testCaseStatus, testCaseType, entityLink, includeAllTests, columnName — alongside the existing excludeIds.

Backend

  • TestCaseResource — when the filter carries search criteria, build a SearchListFilter (reusing the existing buildSearchListFilter + entityLink→entityFQN injection) and route to the repository. No-filter all keeps the original bulk-insert path (backward compatible).
  • TestCaseRepository.addMatchingTestCasesToLogicalTestSuite — resolves matching ids from the search index via search_after deep pagination (listWithDeepPagination, batch 1000, sorted on fullyQualifiedName.keyword), so the count is not capped by max_result_window; drops excludeIds and reuses the existing add-by-ids path.

UI

  • AddTestCaseList — carries the active search/filter into every selectAll payload.
  • useTestSuiteDetailsPage (existing suite) and BundleSuiteFormDrawer (create suite) — forward the filter through.
  • rest/testAPI — new AddTestCaseListFilter type; maps the filter into the bulk request.

Generated TS types regenerated from the schema.

Testing

  • mvn -pl openmetadata-service -am compile — passes
  • mvn -pl openmetadata-integration-tests -am test-compile — passes (new IT test_bulkAddAllRespectsSearchFilter)
  • mvn -pl openmetadata-service,openmetadata-integration-tests spotless:apply — clean
  • UI jest — AddTestCaseList 47/47, BundleSuiteFormDrawer 21/21
  • UI tsc --noEmit — clean; ESLint 0 errors; Prettier clean
  • Pending (needs a live search backend): running test_bulkAddAllRespectsSearchFilter end to end.

Fixes #33556 (with #33654)

RetriggerConfidence Score: 5/5

The PR appears safe to merge; both previous findings are resolved and no new actionable defect remains.

Summary

This PR makes bundle-suite “Select all” operations preserve the active test-case filter end to end and addresses both previous review findings.

  • Extends the bulk-add schema and generated clients with supported test-case search criteria.
  • Propagates the active UI filter and resets global selection when the filter changes.
  • Resolves filtered matches through deep search pagination and writes relationships in bounded batches.
  • Adds UI regression coverage and an integration test for entity-link-filtered bulk additions.
Diagram
sequenceDiagram
  participant UI as AddTestCaseList
  participant API as TestCaseResource
  participant Search as Search Repository
  participant DB as TestCaseRepository

  UI->>UI: Snapshot active search/filter
  UI->>API: "Bulk add (mode=all, filter, excludeIds)"
  alt Filter has search criteria
    API->>Search: Deep-page matching test-case IDs
    loop Each search page
      Search-->>API: Up to 1,000 IDs + search_after cursor
    end
    API->>DB: Add matching IDs in bounded batches
  else No search criteria
    API->>DB: Existing unfiltered bulk-add path
  end
  DB-->>UI: Updated bulk-add response
Loading

Reviews (4) · Last reviewed commit: "Merge branch 'main' into fix/33556-selec..."

@shah-harshit
shah-harshit requested review from a team and chirag-madlani as code owners September 20, 2026 06:32
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Sep 20, 2026
@shah-harshit shah-harshit added the skip-pr-checks Bypass PR metadata validation check label Sep 20, 2026
@shah-harshit shah-harshit self-assigned this Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 5402c94ec30f73445ef6129c999f12507d2f3b8d in Playwright run 36177874547, attempt 1.

✅ 1017 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 56m 23s

⏱️ Max setup 4m 43s · max shard execution 16m 49s · max shard-job elapsed before upload 21m 9s · reporting 5s

🌐 159.77 requests/attempt · 2.10 app boots/UI scenario · 12.69% common-shard skew

Optimization targets still in progress:

  • Application boot ratio was 2.1 per UI scenario (2244 boots / 1071 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 125 0 0 0 0 0
✅ Shard chromium-02 119 0 0 0 0 0
✅ Shard chromium-03 136 0 0 0 0 0
✅ Shard chromium-04 133 0 0 0 0 0
✅ Shard chromium-05 124 0 0 0 0 0
✅ Shard chromium-06 148 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 26 0 0 0 0 0
✅ Shard ingestion-01 34 0 0 0 0 0
✅ Shard reindex-01 17 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 73%
73.24% (106686/145665) 58.58% (65299/111451) 59.78% (21541/36030)

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-25T17:30:23Z)

Blocked the queue: integration-tests-mysql-elasticsearch

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 804 → 804
- 0 added, 0 removed, 1 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/generated/entity/services/ingestionPipelines/ingestionPipeline.ts

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@gitar-bot

gitar-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🔴 High risk · The PR changes persisted suite membership through filter-driven bulk writes

Filtered "Select all" on bundle suites now respects the active search filter end to end, addressing the bug where bulk add ignored filter context. Previous findings—unnecessary fully-qualified class names and redundant suite reloads per batch—have been resolved; filtered bulk adds now batch relationship inserts in a single transaction and call updateLogicalTestSuite once. No issues found.

✅ 2 closed
✅ Quality: Fully-qualified class name used instead of import

📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestCaseResource.java:1269 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestCaseResource.java:1660 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestCaseResource.java:1672-1673 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestCaseResource.java:1682-1683
The new backend code references org.openmetadata.schema.api.tests.Filter by its fully-qualified name at the parameter/type positions in addManyTestCasesToBundleTestSuite, hasSearchCriteria, addFilteredTestCasesToBundleSuite, and buildBulkSearchListFilter, rather than importing it. The repository Java conventions prohibit fully-qualified names in code and require a normal import. Add import org.openmetadata.schema.api.tests.Filter; and use the simple name Filter at these sites.

✅ Performance: Filtered bulk add reloads and reindexes the whole suite on every batch

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCaseRepository.java:1516-1520 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCaseRepository.java:1412-1424
addMatchingTestCasesToLogicalTestSuite calls addTestCasesToLogicalTestSuite once for every 500 IDs. Each call runs two findTo scans over all suite members, then updateLogicalTestSuite loads the suite with "*" fields and sends an update event carrying the full tests list. With N matches that means about N/500 full suite loads and suite reindexes, so the cost grows roughly quadratically. Each batch is also its own transaction, so if a later batch fails the suite keeps a partial add. A better approach is to do the relationship inserts in batches inside one flush, collect the added references, run postLogicalSuiteRelationshipUpdate per batch, and call updateLogicalTestSuite once at the end, the same way addAllTestCasesToLogicalTestSuite does it.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 11 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 11 warning(s) across 4 changed file(s).

Count Rule
6 react-hooks/exhaustive-deps
2 openmetadata-imports/review-sequential-api-calls
1 openmetadata-imports/no-cross-page-imports
1 openmetadata-imports/no-lower-layer-page-imports
1 openmetadata-imports/no-rest-ui-imports
All findings
Location Rule Message
🟡 src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:294:34 react-hooks/exhaustive-deps React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.
🟡 src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:327:35 react-hooks/exhaustive-deps React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.
🟡 src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:672:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchTestCases'. Either include it or remove the dependency array.
🟡 src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:697:5 react-hooks/exhaustive-deps React Hook useCallback has an unnecessary dependency: 'fetchColumnOptions'. Either exclude it or remove the dependency array.
🟡 src/components/DataQuality/AddTestCaseList/AddTestCaseList.component.tsx:794:6 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'items'. Either exclude it or remove the dependency array.
🟡 src/components/DataQuality/BundleSuiteForm/BundleSuiteFormDrawer.tsx:121:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'computeDefaultValues' and 'form'. Either include them or remove the dependency array.
🟡 src/components/DataQuality/BundleSuiteForm/BundleSuiteFormDrawer.tsx:129:11 openmetadata-imports/review-sequential-api-calls Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent
🟡 src/components/DataQuality/BundleSuiteForm/BundleSuiteFormDrawer.tsx:153:7 openmetadata-imports/review-sequential-api-calls Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent
🟡 src/pages/TestSuiteDetailsPage/hooks/useTestSuiteDetailsPage.tsx:54:1 openmetadata-imports/no-cross-page-imports Page features must not import another page feature. Move shared code to components, hooks, interfaces, or pure utilities.
🟡 src/rest/testAPI.ts:47:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/rest/testAPI.ts:47:1 openmetadata-imports/no-rest-ui-imports REST clients must not import UI or state-layer modules. Move shared request/response types to the interface layer.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@shah-harshit
shah-harshit added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit de07fb6 Sep 25, 2026
157 of 160 checks passed

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues are observed when adding test cases to an existing Bundle Suite.

4 participants