Repository navigation
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
…hed-0170 Resolve conflicts with main (16b6974) and fix the tsc error in CustomPropertiesDetailPage.tsx. taskr run 0176.
Code Review ✅ Approved 5 closed / 5 findings🔴 High risk · Converts legacy quality-rule custom-property maps to arrays in current and historical records; a faulty migration could corrupt contract metadata. Aligns ODCS import/export with the v3.1.0 published field shapes and preserves unmapped source metadata across round trips, with export supporting six schema versions selectable via ✅ 5 closed✅ Bug: SLA numbers outside the int range are silently truncated, not reported
✅ Quality: New ODCS wire-format rules are not recorded in docs/decisions
✅ Bug: Custom properties removed in OM come back after an export/import round trip
✅ Edge Case: projectRootQuality aborts mid-loop and leaves rules both relocated and at root
Closed: Bug: physicalName probe misses v3.0.2 and strips its valid physical names
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
| Count | Rule |
|---|---|
| 12 | openmetadata-ui-patterns/no-non-adaptive-palette |
| 4 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:177:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:203:9 |
react-hooks/exhaustive-deps |
The 'handleRunNow' function makes the dependencies of useCallback Hook (at line 270) change on every render. To fix this, wrap the definition of 'handleRunNow' |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:375:41 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-gray-700" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-gray-700) or a semant |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:425:41 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-error-600" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-error-600) or a sema |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:430:41 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-error-600" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-error-600) or a sema |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:530:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has unnecessary dependencies: 'handleRunNow' and 'validateLoading'. Either exclude them or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:547:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchLatestContractResults'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:611:39 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-gray-700" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-gray-700) or a semant |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:628:39 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:text-gray-700" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:text-utility-gray-700) or a semant |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:653:30 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:670:30 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:689:30 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:708:30 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:785:42 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:829:44 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
| 🟡 | src/components/DataContract/ContractDetailTab/ContractDetail.tsx:847:40 |
openmetadata-ui-patterns/no-non-adaptive-palette |
Raw palette class "tw:border-gray-200" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant (tw:border-utility-gray-200) or a se |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
|



Describe your changes
Fixes #33493
Align ODCS import/export with the published field shapes and preserve source metadata that OpenMetadata cannot represent natively. The v3.1 reader accepts team objects, custom-property arrays, scalar values and structured implementations through its compatibility projection; export includes native custom properties, linked quality checks, scoped column rules and structured array items.
Export supports the six published profiles
v3.1.0,v3.0.2,v3.0.1,v3.0.0,v2.2.2andv2.2.1. All four JSON/YAML routes, by ID or fully qualified name, acceptodcsVersion; the default is v3.1.0. The UI offers the same versions in an export dialog.Type of change
High-level design
The export service selects a version-family adapter, serializes native content through the generated model for that exact patch version, overlays preserved JSON, materializes the target format and validates the complete document against the pinned, unmodified published schema. Runtime validation remains necessary because generated POJOs cannot enforce every conditional constraint and preserved metadata is restored after serialization.
odcsPreservedFieldsstores the generic JSON remainder as text, retaining exact decimal values without expanding the search mapping. Schema elements follow their names within their parent rather than column positions. Registered, valid contract custom properties become native OM values through normal validation. Native edits take precedence; recorded native ownership prevents a deleted native value from being restored, while unknown or rejected ODCS custom properties remain preserved.Partially readable quality declarations retain the original JSON and their import-time native projection. That projection uses the selected source object before API storage resolves the target entity name, without recreating native POJOs or changing their defaults. Legacy root rules are normalized into their table/column scopes before capture; empty quality collections are omitted. Export restores omitted types and precision only where the native value has not changed, keeps native rule edits/deletions, and removes unchanged synthetic comparison alternatives. Anonymous identity comparisons account for reader rounding and JSON stringification; actual restoration uses exact comparisons. Operator alternatives come from the bundled schema and apply only to quality rules, not arbitrary nested argument keys.
Normal Java, Python and TypeScript generation entry points share
openmetadata-spec/scripts/prepare_model_schemas.py. Maven owns its build directory; Python and UI generation clean temporary workspaces and retain existing output destinations. Schema inputs stay read-only. There are no ingestion Dockerfile changes. Current and historical legacy quality-rule custom-property maps are migrated to arrays in both database entry points; the migration is idempotent.Trade-offs
Design/provenance: versioned export adapters and schema checksums, generic preservation, caller-owned generation workspaces. Shared license attribution remains in
NOTICEand the specification JAR.Review fixes
Addressed the current review:
The final automated edge-case comment is addressed by projecting legacy relocations atomically: malformed quality, properties, items or schema containers leave the source unchanged. Four regressions cover this behavior.
The thorough review also corrected referenced-schema detection for v3.0.2
physicalName, preserved object-valued custom implementations, and covered anonymous precision cases, rounded-bound normalization, and nested argument names. Independent re-review of02977c06c8df2da96335cdc57ef67275b42aa45freported no remaining actionable blocker in the corrected delta.Tests
Use cases covered
All six profiles, table/column/item quality rules, arbitrary SQL JSON assertions, exact decimals and large numbers, named/anonymous rules, operator replacement, rule reorder/deletion, literal dotted names, table renames, custom-property ownership/deletion, generic JSON storage, invalid export diagnostics, and idempotent migration of current/history records.
Unit and backend integration tests
At
02977c06c8df2da96335cdc57ef67275b42aa45f:0c86de5a77f2280c6dc917ecacfd31a6be6d67fe, with zero failures, errors, skips or flaky results:DataContractResourceIT#testRepairedSqlAssertionsAndDottedColumnsSurviveStoredVersionedExports,#testLegacyRootSqlAssertionsArePreservedAtTheirExportScopes,#testODCSExportIncludesTheContractsOwnTestCasesOnce,#testODCSExportKeepsTheSlaFreshnessForAnImportWithoutTestCases, andODCSCustomPropertiesMigrationIT.-Djsonschema2pojo.skip=true -Dmaven.compiler.useIncrementalCompilation=false; changed source files were recompiled and every selected test executed. The final malformed-container atomicity guard was subsequently verified by all 455 unit tests; the valid-input integration results were reused, rather than rerun after that defensive guard. Coverage percentage was not measured in this focused run.The repository's focused planner selected the affected unit classes plus
DataContractResourceITandODCSCustomPropertiesMigrationIT. They were executed together in one Maven reactor usingmysql-elasticsearch, laneparallel, to avoid compiling the backend twice.The new stored API regression exercises 24 explicit version/route combinations (six versions × four JSON/YAML ID/FQN routes), checks string and precise numeric assertions and dotted column identity, then edits native rules and confirms deleted source rules do not return. Existing tests also cover imported/native custom-property exports, generic metadata storage and invalid preserved content. Migration coverage includes pagination, current and orphan historical versions, unrelated extensions and repeated execution.
Full merge readiness is not claimed: the broader affected matrix, additional database/engine lanes and nightly search/UI suites were not run in this review. The previous head's external Compatibility check timed out; no new CI workflows were dispatched or monitored.
Ingestion / UI evidence
Generation and UI files are unchanged by this review fix. Prior verification on the workspace-generation follow-up: 44 preparation/projection/UI-workspace/cache checks and 81 locked ingestion tooling/generated-model checks passed; Java/Python generation, all 1,129 prepared schemas and all six TypeScript profiles were checked. The existing version selector had 67 Jest tests and two Playwright cases pass, plus type checks, checkstyle and lint. No new browser pass or recording is claimed for this backend follow-up.
Manual testing performed
Earlier live API testing against the versioned-export implementation at
a7b1bec597237dc274e379e60439298287b96edfindependently validated 134 exports against all six pinned schemas and completed 16 ordinary v3 JSON/YAML round trips. Cases included invalid input without side effects, repeat import without duplicate checks, native custom-property edit/deletion, reordered columns, merge/replace, large SLA values and multi-object documents. All 125 owned temporary objects were removed; the original sample contracts remained unchanged.The native
sample_data.ecommerce_db.shopify.customerscontract was also checked through all four export routes with string, integer, number and markdown custom properties, ownership, security, SLAs and four native quality checks. Exported values/types matched the stored OM extension. These live checks predate this review commit and were not repeated here.Known import follow-ups remain explicit: the shared reader rejects legacy v2
developmentstatus; primitive-array item metadata survives ODCS export but its element type is not fully represented in the native contract. Historical import conformance is tracked in #37202.Checklist