Repository navigation
Fixes #37202: support versioned ODCS imports - #37450
Conversation
|
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsVersioned ODCS imports now normalize and map contracts and quality rules across six profiles, so conversion errors could alter persisted contract data or executable checks. Adds versioned ODCS import support for v3.1.0, v3.0.x, and v2.2.x through the same published-schema profiles used by export, with a shared validate-normalize-convert pipeline. No open issues remain; the malformed root quality rule bypass when schema is absent was resolved. ✅ 1 closed✅ Bug: Malformed root quality rules bypass validation when schema is absent
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 |



Describe your changes:
Fixes #37202.
Import ODCS v3.1.0, v3.0.2, v3.0.1, v3.0.0, v2.2.2 and v2.2.1 through the same published-schema profiles used by export. JSON/YAML create and update, YAML parse, and preview now share validation and native conversion.
Type of change:
High-level design:
Implemented UML
Open full-size PNG · Editable SVG
The diagram reflects the implemented architecture, including direct adapter resolution and parent-first legacy ARRAY reconstruction. Selected members are shown.
ODCSProfiles.resolvereads the declared version and returns its registeredODCSVersionAdapterdirectly. The registry owns the fixed adapter and published-schema mappings; there is no intermediate profile record.ODCSImportServiceowns one pipeline: validate the original document, invoke the selected adapter'snormalizeLegacyonly when validation fails, revalidate, then project throughODCSNativeContractConverterinto the existing shared reader. The v2.2, v3.0 and v3.1 family adapters explicitly select their normalization rules; the common compatibility helper contains no version-string dispatch.ODCSPublishedSchemaValidatorowns published-schema checks, andODCSLegacyQualityValidatorvalidates consumed legacy fields before relocation or encapsulation. Generic preserved JSON retains source version/schema identity and unmapped content.Known historical OpenMetadata shapes are normalized explicitly and reported, then validated against the declared profile. Legacy quality payloads are checked against the reader schema before encapsulation, so a recognized alias cannot hide malformed fields. Existing generated models, pinned upstream schemas, model-generation commands and Docker packaging are unchanged.
Tradeoffs:
odcsIdcustom property as its historical ID annotation. Earlier properties survive; embedded source IDs win. A lone user property using that reserved convention is ambiguous. v3.1 properties with that name remain ordinary metadata.The decision and support matrix are in
docs/decisions/2026-11-09-odcs-imports-validate-declared-published-profiles.md. No data migration is required.Tests:
Use cases covered
Unit tests
631 ODCS-focused Java unit tests pass. New import/profile class line coverage:
ODCSImportService97.4%,ODCSImportCompatibility98.9%,ODCSImportQuality97.5%,ODCSProfiles100%.Backend integration tests
All 94 ODCS-related
DataContractResourceITmethods pass against disposable MySQL/Elasticsearch services (188 executions across the configured isolated/parallel lanes).Commands:
Models were generated in the initial fresh-worktree build; the later checks reused those unchanged outputs. Focused verification is complete. Broader non-ODCS integration, search, and nightly checks were not run and merge readiness is not asserted. The Java impact map is complete.
UI tests
73 existing Jest tests pass for
ODCSImportModal,ODCSImportReportand report utilities. No UI code changed.Ingestion integration tests / Playwright
Not applicable — no ingestion or UI implementation changes.
Manual testing performed
Authenticated live API tests against
sample_data.ecommerce_db.shopify.customerson commita2487077200pass all 36 version pairs in both input and output formats: 144 complete import/export/re-import/reverse-export cases, plus six edge checks. All 432 matrix export/re-import/reverse-export responses were HTTP 200; exported documents validate against the pinned schemas. Starting editable contract content was restored; table columns and test case identities/parameters are unchanged. Testing advanced contract version history. See the correction section below for the deployed artifact and focused verification. No browser testing was performed.UI screen recording:
Not applicable — backend import implementation with unchanged UI workflow and response shapes.
Checklist:
REVIEW.mdcompleted atd41fcfbe6ab04b32fd3529b7f33490fabb5aeb0c; all findings resolved. Review regressions cover scalar versus array assertions, malformed legacy payloads, parameter/unit edits, and metadata edits/deletions through wrapper decoding.Cross-version export correction (2026-11-10)
Preserved source metadata is normalized only for versioned export. Source-only keys travel in scoped
customPropertiesannotations and return as fields when the requested published schema accepts them. Description arrays retain an editable text projection and their exact original array. Native fields and aliases retain precedence; stale projections cannot resurrect edited or deleted values. Existing stored contracts benefit without migrations, schema generation, UI or Dockerfile changes.v3.0.x library rules now convert both renamed aliases and unchanged metric names, including
rowCount. The recognized current names come from the generated v3.1 schema model. The v3.1 exporter repeats quality normalization after the metadata overlay, which can restore source-versionrulefields. Existing nativemetricvalues remain authoritative; unrecognized legacy names retain their existing compatibility handling.The metadata tradeoff is a visible reserved compatibility annotation when source content has no direct target representation. Unknown field names are discovered from the pinned schema, so preservation needs no new field allowlist. The generic payload remains unchanged in storage.
Verification on
a2487077200:testVersionedODCSImportMatrix,testVersionedODCSInvalidDocumentsHaveNoSideEffects, andtestNativeCustomPropertiesExportAsValidOdcsAcrossAllRoutes. The expanded matrix covers table row-count and column not-null rules and validates all six export targets after every YAML/JSON import. Its rule/test identity assertions compare complete sorted lists.ODCSImportQuality98.4%;ODCSV31Mapper94.7%.Latest live validation was rerun against the user-rebuilt local server. Both its API and the service JAR in the rebuilt distribution archive report revision
a2487077200b6fd26950f46404d7a316988b7ff1(server build timestamp1794352921045). All 144 complete version/format round trips and all six edge checks passed. Starting editable contract content was restored exactly; table columns and test case identities, scopes, definitions and parameters are unchanged. Testing advanced contract version history.The metadata design and tradeoffs are documented in
docs/decisions/2026-11-09-odcs-imports-validate-declared-published-profiles.md.Scalar-column export correction (2026-11-11)
Commit
28a5afee88c15180780adc328c004b5d6facb65efixes published-schema export failures when native scalar columns (for example VARCHAR) contain children. The shared mapper retains the declared scalar type and omits its children from exported ODCS; stored metadata is unchanged. Objects (STRUCT/MAP/JSON) and arrays retain their children. The behavior applies recursively and across the six export profiles. Seedocs/decisions/2026-11-11-odcs-scalar-columns-omit-native-children.md.Verification:
DataContractResourceIT#testODCSExportScalarColumnWithChildrenpassed in the parallel MySQL/Elasticsearch lane: 16 HTTP exports (four v3 profiles × JSON/YAML by ID/FQN) returned 200, validated against the published schemas, and left the stored scalar children intact.mvn -B -pl openmetadata-integration-tests failsafe:verify -Dsonar.skip=truesuccessfully verified the saved integration results without rerunning them.Import pipeline refactor verification
Commit
ad41d9f37bc0ca8ee1121c61f3e20ddd239da985implements the shared pipeline and family-owned normalization described above. Version diagnostics, caller immutability, recognized legacy forms, quality declarations, canonical source metadata and export behavior are preserved. The decision is recorded indocs/decisions/2026-11-11-odcs-import-pipeline-selects-profile-owned-normalizers.md.ODCSImportPipelineTestcases for published-input bypass, malformed root references with/without schema, version diagnostics and source immutability. Existing versioned import and cross-version round-trip tests exercise the new components through the public importer and exporter, so they do not need direct references to every extracted class.DataContractResourceITmethods passed in the parallel MySQL/Elasticsearch lane:testVersionedODCSImportMatrix,testVersionedODCSInvalidDocumentsHaveNoSideEffects,testSchemaLessODCSInvalidQualityHasNoSideEffects, andtestODCSExportScalarColumnWithChildren.ODCSImportService,ODCSLegacyQualityValidator,ODCSNativeContractConverter,ODCSImportCompatibilityandODCSPublishedSchemaValidator100%;ODCSProfiles96.4%; v2.2/v3.0/v3.1 mappers 98.0%/96.1%/94.4%.Commands used for focused execution:
Direct adapter resolution
Commit
ededa7578a412c6dbf858fd6d33b4dca5faafb57removes the redundantODCSProfilerecord.ODCSProfileskeeps the fixed adapter/schema mappings;resolvereturns the adapter directly. Import and conversion use that adapter, and schema validation uses its declared version. The existing pipeline decision record includes the amendment.The focused Maven verification was rerun successfully with all 768 ODCS unit tests and the same four parallel MySQL/Elasticsearch
DataContractResourceITmethods listed above. This used the recorded verify command with-Dtest=ODCS*Testso unit and API tests ran together. Line coverage: registry 96.2%; importer, converter and published-schema validator 100%. Formatting, normal commit/push hooks, impact-map checks and independent review passed at this commit. No additional test cases were needed for the behavior-preserving removal. Broader non-ODCS/API/search/nightly checks remain deferred; merge readiness is not asserted.Legacy ARRAY column-order correction and live verification
Commit
b3e9f3256dc2526e02fdc1d2754d279cc9ba130ffixes v2.2.1/v2.2.2 flattened children declared before their ARRAY parents. Reconstruction parses qualified paths once and processes parents before descendants, so both outer and nested native arrays retainarrayDataType: STRUCT. Existing item metadata and quoted column names containing literal dots survive.Verification at this commit:
ODCSV22Mapper199/204 lines (97.5%). Spotless, normal commit/push hooks, impact-map ownership and independent review passed; review found no actionable findings./tmp/odcs-live-fixed-20261111/report.htmlandvalidated-summary.json. Broader non-ODCS and nightly suites were not rerun; merge readiness is not asserted.Focused commands (successful):