Skip to content

Fixes #30362: Allow custom dimension for test cases - #32071

Merged
TeddyCr merged 49 commits into
mainfrom
agent/issue-30362
Sep 15, 2026
Merged

TeddyCr merged 49 commits into
mainfrom
agent/issue-30362

Conversation

@TeddyCr

@TeddyCr TeddyCr commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #30362

A data quality dimension was a fixed enum of eight values baked into the test definition schema. This makes it a first-class entity, so teams can register their own — a BCBS 239, a Timeliness — classify test definitions and individual test cases under them, and have those dimensions drive the Data Quality dashboards and filters like the shipped ones do.

Type of change:

  • New feature
  • Improvement

High-level design:

A dimension is an entity. New dataQualityDimension entity + /v1/dataQuality/dimensions resource, with the eight shipped dimensions seeded as provider: system (immutable, undeletable). Users create their own in Settings → Preferences → Data Quality.

A test case stores its dimension as a relationship, not a lookup. This is the central design decision. Dimensions are read far more often than written — every list, every dashboard aggregation, every search document — so the value is materialised onto the test case as a relatedTo relationship rather than resolved from the test definition on each read. Reads stay one batched query; nothing walks through to the definition.

That choice has a consequence: a change to a test definition has to be pushed down, it can't be picked up later. So a relationship written from the test definition carries an {"inherited": true} marker on the entity_relationship.json column, and TestDefinitionRepository handles all three transitions when a definition is reclassified:

transition what happens
A → B inherited rows repointed to B
A → null inherited rows removed
null → B inherited rows created

Each is a single join-scoped SQL statement — scoped through the testDefinition → testCase edge rather than an IN (…) list — so a definition backing a hundred thousand test cases costs one statement and no heap. A dimension set on the test case itself carries no marker and is never touched, which is what makes a per-test-case override survive its definition being reclassified.

Deleting a dimension is repaired the same way, asynchronously (AsyncService): the test definitions naming it are cleared, and the affected test cases are re-indexed a page at a time.

Alternatives rejected. Resolving the dimension at read time (no materialisation) was tried and reverted — it made reads pay per entity and left TestCaseIndex, useTestCaseResultTab and the settings counts each carrying their own fallback. Counting inherited test cases on the fly instead of materialising them was rejected for the same reason.

Migration. TestDefinition.dataQualityDimension changes from the DataQualityDimensions enum to an entityName string — the enum is kept in the schema for backwards compatibility but nothing $refs it, so it is no longer generated. The 2.1.0 post-migration script backfills a relationship for every pre-existing test case from its definition's dimension; it is idempotent and marks every row inherited. Without it the API returns no dimension for legacy test cases and the settings page counts them as zero.

Downstream: the generated enum disappearing breaks Collate's SlackEntityDataResolver.value() call — fixed in openmetadata-collate#6633, which can only go green once this merges.

Tests:

Use cases covered

  • Admin registers a custom dimension, edits its name/colour/description, deletes it
  • System dimensions cannot be edited or deleted
  • A test case created without a dimension inherits its test definition's; one created with a dimension keeps it
  • Reclassifying a test definition moves its inherited test cases and leaves explicit overrides alone
  • Clearing a test definition's dimension drops the inherited ones; setting it again recreates them
  • Deleting a dimension clears it from the test definitions that named it and from its test cases
  • Custom dimensions are selectable in the Data Quality page's Dimension filter and appear in the Status-by-Dimension widget
  • Upgrading an existing deployment leaves every pre-existing test case with the dimension its definition carried

Unit tests

  • TestCaseRepositoryTest, TestCaseIndexTest, SearchListFilterTest, DataQualityDimensionSqlMigrationParityTest, EntityLinkGrammarTest
  • UI: DataQualitySettingsPage.test.tsx (new — the page had none), useTestCaseFilterOptions.test.tsx, DataQualityUtils.test.ts, TestCaseResultTab.test.tsx, TestDefinitionList.test.tsx
  • 1,270 tests pass across the DataQuality / TestLibrary UI suites

Backend integration tests

  • Added openmetadata-integration-tests/.../DataQualityDimensionPropagationIT.java — 13 tests, the full transition matrix plus the non-happy paths: unknown dimension rejected, system dimensions immutable and undeletable, duplicate names 409, deletion isolated to the affected definition, no duplicate relationships across repeated reclassification, and a regression test for PUT /v1/dataQuality/testDefinitions returning 404.

Ingestion integration tests

  • Not applicable (no ingestion changes) — but note this PR fixes the Python ingestion suites, which were failing because create_or_update on a test definition returned 404. EntityMapper.copy assigns a fresh UUID before the repository decides create-vs-update, so looking the existing entity up by id alone threw; it now falls back to a name lookup.

Playwright (UI) tests

  • Not added. The settings page is new and previously had no coverage at all; the jest suite added here covers create/edit/validation/delete-confirm. Worth a follow-up.

Manual testing performed

Full manual pass by @TeddyCr on both engines:

  1. MySQL, at scale — loaded a synthetic catalog (200 tables / 5,000 test cases / 100,000 results) and ran the upgrade path over it
  2. Postgres — same migration path
  3. Ran the migration on an existing database rather than a fresh install, and verified the backfill against a live local psql session
  4. Executed test cases live against the local Postgres database

Also verified during development, against the running stacks:

  • backfill inserts exactly the pre-existing test cases and re-runs as a no-op (5000 then 0)
  • the repoint/remove/insert statements move inherited rows only, leaving an explicit override in place — checked on MySQL inside a rolled-back transaction and on a scratch Postgres 15 seeded to the same shape, because the two dialects need different DML (UPDATE … JOIN vs UPDATE … FROM, DELETE … JOIN vs DELETE … USING)

UI screen recording / screenshots:

Screen.Recording.2026-09-11.at.10.50.45.AM.mov
Screen.Recording.2026-09-11.at.11.01.48.AM.mov

Recordings predate the settings-page rebuild described below; the flows are unchanged.

Notes for reviewers

The settings page is built on @openmetadata/ui-core-components, not Ant Design. It was originally written with antd, which CLAUDE.md rules out for new work and which the Antd + Less deprecation guard fails the build on. Nothing needed antd — the two things the page reuses (the shared Table, the form drawer atom) aren't antd-coupled — so the page, its form and its delete modal were rebuilt on core-components, with the form moving from antd's Form to react-hook-form.

Known limitation, deliberate: test_case_result documents already indexed keep the dimension they were recorded under. Changing a test case's dimension does not rewrite history.

One fix is reasoned, not test-proven. The drawer's onClose fires twice — once from closeDrawer, once when the overlay finishes its exit transition — and the late call was wiping a form the open path had just seeded. The reset is removed, but jsdom doesn't run exit transitions so the added tests pass with and without it; that one wants a browser.

Test cases could only be categorized through the dimension of their test
definition, which is a closed enum — so dimensions outside the ones shipped
with OpenMetadata (Timeliness, Traceability, Availability... as used for
BCBS 239) could not be expressed, and every test case built from the same
definition was stuck with the same dimension.

A test case now carries its own `dataQualityDimension`, a free-form string:
- it defaults to the dimension of its test definition when not provided
  (cleared values reset to that default);
- any custom dimension can be set on creation or later through a patch;
- the search index prefers the test case dimension and falls back to the
  test definition one, so existing test cases and the dimension filters and
  dashboard aggregations keep working unchanged.

In the test case form, the dimension is a creatable combobox prefilled from
the selected test type, listing the built-in dimensions as suggestions while
letting users type in their own.
Copilot AI lite review requested due to automatic review settings August 25, 2026 20:40
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@olivaw-build olivaw-build Bot mentioned this pull request Aug 25, 2026
1 task done
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.88% (102664/140861) 57.69% (62338/108041) 58.85% (20398/34658)

@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 7e7637b7cdba9a7ed756c6f7c32ee815ec05cea3 in Playwright run 34985854556, attempt 1.

✅ 4501 passed · ❌ 0 failed · 🟡 8 flaky · ⏭️ 1 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) 1h 8m 25s

⏱️ Max setup 4m 30s · max shard execution 22m 50s · max shard-job elapsed before upload 25m 56s · reporting 20s

🌐 220.97 requests/attempt · 2.23 app boots/UI scenario · 44.45% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 44.45% (convergence target: at most 15%).
  • Browser traffic was 220.97 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.23 per UI scenario (10692 boots / 4793 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 65 0 0 0 0 0
✅ Shard advanced-search-02 65 0 0 0 0 0
✅ Shard chromium-01 143 0 0 0 0 0
✅ Shard chromium-02 139 0 0 0 0 0
🟡 Shard chromium-03 172 0 1 0 0 0
✅ Shard chromium-04 142 0 0 0 0 0
✅ Shard chromium-05 164 0 0 0 0 0
🟡 Shard chromium-06 170 0 1 0 0 0
✅ Shard chromium-07 153 0 0 1 0 0
✅ Shard chromium-08 127 0 0 0 0 0
✅ Shard chromium-09 154 0 0 0 0 0
✅ Shard chromium-10 169 0 0 0 0 0
✅ Shard chromium-11 197 0 0 0 0 0
🟡 Shard chromium-12 196 0 1 0 0 0
✅ Shard chromium-13 174 0 0 0 0 0
✅ Shard chromium-14 139 0 0 0 0 0
🟡 Shard chromium-15 168 0 1 0 0 0
✅ Shard chromium-16 178 0 0 0 0 0
✅ Shard chromium-17 163 0 0 0 0 0
✅ Shard chromium-18 154 0 0 0 0 0
✅ Shard chromium-19 161 0 0 0 0 0
🟡 Shard chromium-20 186 0 1 0 0 0
✅ Shard chromium-21 164 0 0 0 0 0
🟡 Shard chromium-22 174 0 2 0 0 0
✅ Shard chromium-23 191 0 0 0 0 0
🟡 Shard chromium-24 165 0 1 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 68 0 0 0 0 0
✅ Shard import-export-02 82 0 0 0 0 0
✅ Shard ingestion-01 47 0 0 0 0 0
✅ Shard ingestion-02 47 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 8 flaky test(s) (passed on retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify LineageSearchSelect in lineage mode (shard chromium-03, 1 retry)
  • Features/CuratedAssets.spec.ts › Multiple entity types with AND conditions (shard chromium-06, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article list cards, recently viewed widget, and pagination work (shard chromium-12, 1 retry)
  • Features/Glossary/GlossaryAdvancedOperations.spec.ts › should remove owner from term (shard chromium-15, 1 retry)
  • Pages/ServiceEntity.spec.ts › Tier Add, Update and Remove (shard chromium-20, 1 retry)
  • Features/ContextCenterArchive.spec.ts › file in deleted folder is absent from search and not added to archive (shard chromium-22, 1 retry)
  • Pages/UserDetails.spec.ts › Admin user can edit teams from the user profile (shard chromium-22, 1 retry)
  • Features/DataProductRename.spec.ts › should handle multiple consecutive renames and preserve assets (shard chromium-24, 1 retry)

📦 Download artifacts

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

TeddyCr and others added 2 commits September 11, 2026 16:08
The 2.1.0 backfill that gives pre-existing test cases the dimension of
their test definition never inserted anything. It joined against
data_quality_dimension from postDataMigrationSQLScript.sql, but the
dimension entities are seeded from JSON resources during server startup,
while the SQL migrations run to completion in a separate step before the
server boots. The join matched an empty table, and because migration
statements are checksummed as applied it never got a second chance --
every upgraded deployment was left with no dimension on any pre-upgrade
test case, permanently.

Observed on a real upgrade: migrations finished at 21:58:36, the
dimensions were seeded at 21:58:44, and all three pre-existing test cases
came out with no dimension -- reported as none by the API, bucketed under
"No Dimension" on the dashboards, and immovable by reclassification since
repointInheritedVia only updates rows that already exist.

Moved to DataQualityDimensionMigration in migration/utils/v210, which
seeds the system dimensions from the same JSON resources the server uses
before running the backfill, so both sides of the join exist. The startup
seeding then finds them by name and skips. Same anti-join as before, so
it stays idempotent and leaves an explicitly-chosen dimension alone.

Covered by DataQualityDimensionMigrationIT, which removes the dimension
entity as well as the relationship to reproduce the pre-upgrade shape --
deleting only the relationship passes with or without the fix and would
not have caught this.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01JWyP9RA8MNYr9nFd73x1mA

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ShaileshParmar11 ShaileshParmar11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the UI half of this PR against .claude/rules/ (i18n, styling, a11y, component-library, react) and the merge base, so everything flagged is new code in this PR rather than pre-existing practice.

The design holds up. The settings page really is on the go-forward stack — no antd imports, no any, no hex in JSX, real react-hook-form + Controller, admin-gated route (AdminProtectedRoute + isProtected: isAdminUser), i18n keys throughout. resolvePatchedDimension extends the resolvePatched* pattern already in DataQualityPureUtils rather than inventing a parallel one, and the "untouched inherited prefill" handling is subtle and correct.

One thing I'd call blocking: the 15 new locale keys are English in all 19 non-English files. Everything else below is a should-fix or a nit.

Worth knowing what CI isn't catching here, since it's green: token-audit is not a ui-checkstyle step; tw-deprecation-guard reports new .less files without failing (only new antd imports block — so the PR description's "the guard fails the build on Less" isn't quite right); and check-i18n-all verifies key sync, never translation.

One open question, not a defect: once a test case has an explicit dimension there's no way back to inheriting. Re-picking the definition's current default writes a fresh non-inherited row, and clearing the field emits a remove that the backend reads as no dimension — while the field's own help text says it "defaults to the dimension of the test type". Intended for this iteration, or worth a "reset to inherited" affordance?

@ShaileshParmar11 ShaileshParmar11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up on the dimension options fetch — one more inline comment.

@ShaileshParmar11 ShaileshParmar11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second pass, this time purely on simplification and reuse — no rules, no bugs. One finding with real leverage and a handful of small ones.

The dimension picker is built four times

getDataQualityDimensions({ limit: 1000 }) appears in four files, and three of them wrap it in near-identical useState + useEffect + .then/.catch + option-shaping:

File Option shape Error degrades to
TestCaseFormBody.tsx:696 Map<string, FormSelectItem> []
TestDefinitionFormBody.tsx:107 Map<string, FormSelectItem> []
useTestCaseFilterOptions.tsx:80 { label, name, value } TEST_CASE_DIMENSIONS_OPTION
DataQualitySettingsPage.tsx:111 raw entities {}

The two form builders are the same ~15 lines twice. A single useDataQualityDimensions() hook collapses all four, and takes these with it rather than needing four separate fixes:

  • the magic 1000 in four places — AGGREGATE_PAGE_SIZE_LARGE already exists in constants/constants.ts:61
  • no loading state in either form picker, while the table ASYNC_SELECT next door passes isLoading
  • a refetch on every form mount with no cache, where fetchTables in the same file keeps a bounded LRU
  • three different degradations for one failure mode
  • one place to move to ASYNC_SELECT + server-side search later, instead of three

That last point also closes the separate FieldTypes.SELECT thread — SELECT never refreshes its collection when options land late, which is exactly what a mount-time fetch produces.

Also worth a look

Inline threads cover: the filter().map() / no-op String() / double getEntityName() / mismatched catch shape in fetchDimensionOptions; displayName ?? name hand-rolled in both form bodies where getEntityName() is used elsewhere (and behaves differently on an empty displayName); and three small ones grouped onto the settings page.

Not flagged — these got simpler, and I checked

TestDefinitionTable.component.tsx reordering the tooltip if/else to check permission first removes a redundant branch. TestCaseResultTab.utils.ts swapping a four-term || chain for [...].some(Boolean) is the right direction. transformTestDefinitionFormData's patch.filter(op => op.path === DIMENSION_PATH) exact-match is correct now that dataQualityDimension is a flat string.

olivaw added 2 commits September 15, 2026 13:18
- share the dimension fetch/picker via useDataQualityDimensions() and
  getDimensionSelectOptions(), labelling with getEntityName()
- make the test case dimension field an AUTOCOMPLETE with a loading state
- report an unknown reference count as unknown, not as zero, when deleting
- model the settings drawer as a discriminated union and seed the form once
- reuse the shared DeleteModal so Esc/backdrop/Cancel lock while deleting
- make the colour palette a radiogroup with readable names and key nav
- token-ise the settings page styles and draw the swatch ring with outline
- import ProviderType from the test definition schema
- close the JDBI handle in DataQualityDimensionMigrationIT
- cover create/patch/delete/validation/impact counts with unit tests and
  assert a read-only field in the system test definition Playwright specs
- translate the new locale keys in all 19 non-English catalogs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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: 774 → 774
- 0 added, 0 removed, 1 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/components/TestLibrary/TestDefinitionForm/TestDefinitionFormBody.tsx

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 112 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), 112 warning(s) across 18 changed file(s).

Count Rule
71 no-restricted-imports
14 openmetadata-imports/no-lower-layer-page-imports
11 openmetadata-imports/no-circular-imports
6 openmetadata-imports/no-impure-pure-utils
5 react-hooks/exhaustive-deps
3 openmetadata-imports/no-internal-barrel-imports
1 openmetadata-imports/review-sequential-api-calls
1 openmetadata-imports/no-rest-ui-imports
All findings
Location Rule Message
🟡 src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.test.tsx:28: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/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.tsx:59: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/components/DataQuality/AddDataQualityTest/components/TestCaseFormDrawer.tsx:40: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/components/DataQuality/AddDataQualityTest/components/TestCaseFormDrawer.tsx:233:9 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/AddDataQualityTest/components/transformTestCaseFormData.ts:32: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/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.component.tsx:19: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/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.component.tsx:20:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.component.tsx:24:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.component.tsx:30:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.test.tsx:16: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/components/DataQuality/IncidentManager/TestCaseResultTab/TestCaseResultTab.component.tsx:21: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/components/DataQuality/TestCases/TestCases.component.tsx:27: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/components/DataQuality/TestCases/TestCases.component.tsx:28: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/components/DataQuality/TestCases/TestCases.component.tsx:40:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/components/DataQuality/TestCases/useTestCaseFilterOptions.tsx:247:34 react-hooks/exhaustive-deps React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.
🟡 src/components/DataQuality/TestCases/useTestCaseFilterOptions.tsx:251:35 react-hooks/exhaustive-deps React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.
🟡 src/components/DataQuality/TestCases/useTestCaseFilterOptions.tsx:255:39 react-hooks/exhaustive-deps React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.
🟡 src/components/DataQuality/TestCases/useTestCaseFilterOptions.tsx:259:43 react-hooks/exhaustive-deps React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.
🟡 src/components/DataQuality/TestCases/useTestCaseFilters.ts:224:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'getInitialOptions', 'handleSearchParam', and 'onSearchByKey'. Either include them or remove the dependency array.
🟡 src/components/DataQuality/TestCases/useTestCaseListPage.tsx:20:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/components/DataQuality/TestCases/useTestCaseListPage.tsx:20: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/components/DataQuality/TestCases/useTestCaseListPage.tsx:21: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/components/DataQuality/TestCases/useTestCaseListPage.tsx:22: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/constants/DataQuality.constants.ts:13:1 no-restricted-imports '../assets/svg/ic-aborted.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstra
🟡 src/constants/DataQuality.constants.ts:14:1 no-restricted-imports '../assets/svg/ic-fail.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstracti
🟡 src/constants/DataQuality.constants.ts:15:1 no-restricted-imports '../assets/svg/ic-successful.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abs
🟡 src/constants/profiler.constant.ts:16:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/pages/DataQualitySettingsPage/DataQualitySettingsPage.tsx:26:1 openmetadata-imports/no-internal-barrel-imports Import the internal module directly instead of its index barrel so unrelated siblings do not enter the bundle graph.
🟡 src/rest/dataQualityDimensionAPI.ts:19:1 openmetadata-imports/no-internal-barrel-imports Import the internal module directly instead of its index barrel so unrelated siblings do not enter the bundle graph.
🟡 src/rest/testAPI.ts:47:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 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.
🟡 src/rest/testAPI.ts:49:1 openmetadata-imports/no-internal-barrel-imports Import the internal module directly instead of its index barrel so unrelated siblings do not enter the bundle graph.
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:27:1 no-restricted-imports '../../assets/svg/ic-accuracy.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated ab
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:28:1 no-restricted-imports '../../assets/svg/ic-completeness.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designate
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:29:1 no-restricted-imports '../../assets/svg/ic-consistency.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:30:1 no-restricted-imports '../../assets/svg/ic-integrity.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated a
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:31:1 no-restricted-imports '../../assets/svg/ic-sql.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstrac
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:32:1 no-restricted-imports '../../assets/svg/ic-uniqueness.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:33:1 no-restricted-imports '../../assets/svg/ic-validity.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated ab
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:34:1 no-restricted-imports '../../assets/svg/no-dimension-icon.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designa
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:35:1 openmetadata-imports/no-impure-pure-utils Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer.
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:36:1 openmetadata-imports/no-impure-pure-utils Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer.
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:37:1 openmetadata-imports/no-impure-pure-utils Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer.
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:38:1 openmetadata-imports/no-impure-pure-utils Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer.
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:40:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:57:1 openmetadata-imports/no-impure-pure-utils Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer.
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:57: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/utils/DataQuality/DataQualityPureUtils.ts:61:1 openmetadata-imports/no-impure-pure-utils Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer.
🟡 src/utils/DataQuality/DataQualityPureUtils.ts:66:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.

… and 62 more. Run make ui-checkstyle-changed locally for the full list.


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

make ui-checkstyle-changed

@github-actions

Copy link
Copy Markdown
Contributor

✅ Generated Sources Auto-Updated

The generated TypeScript types (src/generated/) and dereferenced JSON
schemas (src/jsons/, public/jsons/) have been automatically updated
based on JSON schema changes in this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Sep 15, 2026 •

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

Enables custom data quality dimensions as first-class entities while materializing dimension relationships onto test cases to avoid per-read resolution costs. Dimension term filter escaping, deletion blocking unrelated edits, reindex timing, and redundant lookups have all been addressed.

✅ 6 closed
✅ Security: Dimension term filter escaping ignores backslashes

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/SearchListFilter.java:447-454 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/SearchListFilter.java:399-401
getDataQualityDimensionCondition now interpolates the free-form, user-supplied dimension into a raw JSON term query using escapeDoubleQuotes(), which only replaces " with ". It does not escape backslashes, so a dimension value such as foo\ produces {"term": {"field": "foo"}} — the trailing backslash escapes the closing quote and yields invalid JSON, breaking the query (and, with a crafted value, allowing JSON structure injection into the Elasticsearch query). Escape backslashes before double quotes, or build the query with a JSON serializer / parameterized term instead of String.format.

✅ Edge Case: Deleted custom dimension blocks unrelated test-definition edits

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestDefinitionRepository.java:56-70
prepare() now calls validateDataQualityDimension() unconditionally on every create and update, resolving the dimension name via Entity.getEntityReferenceByName(..., Include.NON_DELETED), which throws EntityNotFoundException when the name is missing. If a custom dimension a test definition references is later deleted, any subsequent PATCH — even one that only toggles enabled and never touches the dimension — will fail with a 404 for the dangling reference. Consider validating only when the dimension value actually changes (compare against the existing entity on update) so unrelated edits are not blocked by a stale reference.

✅ Bug: Reindex scheduled before update transaction commits

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestDefinitionRepository.java:200-208 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestDefinitionRepository.java:390-397
In TestDefinitionUpdater.updateDataQualityDimension(), the relationship repoint (repointInheritedVia/addInheritedVia/removeInheritedVia) runs synchronously inside the JDBI @Transaction of entitySpecificUpdate, and then AsyncService.executeDatabaseTask(...) schedules reindexTestCasesOf on a separate virtual thread while that transaction is still open. The reindex reads relationships on a fresh connection; if it wins the race and starts before the outer transaction commits, it rebuilds the affected test cases' search documents from the OLD (pre-repoint) dimension and nothing ever re-triggers them, leaving the Data Quality dashboards permanently reporting the stale dimension for those cases. The code comment claims "the relational change is already committed and authoritative," but at the point of submission it is not yet committed. Defer the async submission until after the transaction commits (e.g. a post-commit hook) so the reindex always observes the new relationships.

✅ Quality: Redundant dimension lookups before no-op equality check

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestDefinitionRepository.java:134-140
propagateDimensionToTestCases resolves both previous and current via findDimensionOrNull (two getEntityReferenceByName lookups) before the Objects.equals(previousDimension, newDimension) early-return. When the dimension is unchanged, both lookups are wasted work. Move the equality check to the top of the method so the no-op case returns before doing any resolution.

Closed: Bug: Parameter-only edit pins inherited dimension as override

📄 openmetadata-ui/src/main/resources/ui/src/utils/DataQuality/DataQualityPureUtils.ts:224-230 📄 openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/transformTestCaseFormData.ts:471
Removing the showOnlyParameter || guard means the parameter-only drawer now writes /dataQualityDimension into the patch whenever the form value has the key. But the field is prefilled with the inherited definition dimension (transformTestCaseFormData.ts uses testCase.dataQualityDimension?.name ?? definition.dataQualityDimension), and toDimensionReference turns that inherited string into a concrete EntityReference. So a user who opens the drawer merely to edit a SQL parameter—never touching the dimension—silently converts a test case that inherited its dimension into one that overrides it with the same value, decoupling it from future changes to the definition's dimension. Consider only emitting the override when the submitted value differs from the definition's inherited dimension (e.g. pass the resolved inherited dimension into createUpdatedTestCasePatch and skip the patch when they match), or otherwise distinguish an inherited prefill from a deliberate override.

...and 1 more closed from earlier reviews

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

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

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

Ingestion safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow custom dimension for test cases

7 participants