Repository navigation
TEST - Add Data Contract ODCS tests - #25588
Conversation
When schema validation detects type mismatches (e.g., expected INT, got STRING), the UI now shows these as warnings in the success panel instead of hiding them. The chip displays "Passed with Warnings" with a warning color scheme, and each type mismatch is listed with a warning icon. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Changed parseOpenMetadataContent to check for 'name' field instead of 'entity' - Made parse error panel format-aware: shows ODCS required fields (APIVersion, Kind, Status) for ODCS imports, and OM required field (name) for OM imports - Added translation key for OM format required fields error message Co-Authored-By: Claude Opus 4.5 <[email protected]>
The ODCS schema defines the role identifier field as 'role', not 'name'. Using 'name' caused the parser to set role to null, which made the export default to 'data-consumer'. Fixed all role definitions in test fixtures to use the correct 'role' field. Co-Authored-By: Claude Opus 4.5 <[email protected]>
The test was expecting 'data-consumer' in the exported YAML, but the input ODCS_VALID_FULL_YAML contains roles 'data_admin' and 'analyst'. Updated assertion to check for 'analyst' which matches the input. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Code Review ✅ Approved 0 resolved / 2 findingsNo changes to review - diff is empty. This PR appears to have been merged or there are no new changes since the last review. Previous findings cannot be verified without diff content. 💡 Edge Case: Test assertion allows validation error but doesn't verify behavior📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/DataContractResourceIT.java In For a robust test, consider:
The current approach makes it unclear what the intended behavior is and may mask actual bugs where the wrong exception type is thrown. 💡 Quality: Temp file cleanup could fail if test throws before unlink📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ODCSImportExport.spec.ts Multiple tests download YAML files to Consider moving the cleanup to the finally {
try {
if (tempPath && fsModule.existsSync(tempPath)) {
fsModule.unlinkSync(tempPath);
}
} catch { /* ignore cleanup errors */ }
await table.delete(apiContext);
}This ensures temp files are always cleaned up even when tests fail. This pattern should be applied to all 3 affected tests: 'Import ODCS, modify via UI...', 'Import ODCS, update description...', and 'Import ODCS with SLA, modify SLA...'. OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
Changes have been cherry-picked to the 1.12.0 branch. |
|



Describe your changes:
example:

Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
ODCSImportExport.spec.tscovers ODCS import/export workflows, SLA editing, and markdown renderingODCSImportExportPermissions.spec.tsvalidates RBAC for Data Consumer, Data Steward, EditAll, ViewOnly, and table owner rolescontractValidation.jsonschemaDataContractService,DataContractRepository, andDataContractResourcewith validation endpoints and type compatibility mappingDataContractResourceIT.javafor large schemas, type mismatches, duplicate columnsODCSImportModalwith comprehensive validation UI showing entity/constraint/schema errorsdataContracts.tsincluding valid/invalid contracts and markdown descriptionsThis will update automatically on new commits.