Skip to content

Comments

TEST - Add Data Contract ODCS tests#25588

Merged
pmbrull merged 25 commits intomainfrom
odcs-31-test
Feb 4, 2026
Merged

TEST - Add Data Contract ODCS tests#25588
pmbrull merged 25 commits intomainfrom
odcs-31-test

Conversation

@pmbrull
Copy link
Collaborator

@pmbrull pmbrull commented Jan 28, 2026

Describe your changes:

  • Main change has been adding contract validation in the BE when importing OM contracts, not only ODCS.
  • Added specific column validations as well, checking duplicates and mismatching types
  • If the contract was to fail due to JSON Schema validations, now that's going to be part of the check. E.g., contract with a super long name that breaks JSON check of length <256
  • Added more BE and playwrights

example:
image

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Summary by Gitar

  • New E2E tests:
    • ODCSImportExport.spec.ts covers ODCS import/export workflows, SLA editing, and markdown rendering
    • ODCSImportExportPermissions.spec.ts validates RBAC for Data Consumer, Data Steward, EditAll, ViewOnly, and table owner roles
  • Backend enhancements:
    • Added comprehensive validation logic with new contractValidation.json schema
    • Enhanced DataContractService, DataContractRepository, and DataContractResource with validation endpoints and type compatibility mapping
    • Implemented type normalization for ODCS imports (STRING→VARCHAR, INT→BIGINT, NUMBER→DOUBLE) to ensure compatibility
    • Added 11 edge case tests in DataContractResourceIT.java for large schemas, type mismatches, duplicate columns
  • Frontend improvements:
    • Enhanced ODCSImportModal with comprehensive validation UI showing entity/constraint/schema errors
    • Added TypeScript types for contract validation
  • Test fixtures:
    • Added 10+ ODCS YAML samples in dataContracts.ts including valid/invalid contracts and markdown descriptions

This will update automatically on new commits.


@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
65.87% (55656/84497) 45.02% (28822/64027) 47.81% (8760/18321)

@gitar-bot
Copy link

gitar-bot bot commented Feb 4, 2026

Code Review ✅ Approved 0 resolved / 2 findings

No 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 testImportODCSWithVeryLongContractName, the test catches an OpenMetadataException and only checks that the message contains certain keywords. However, the comment suggests this behavior is uncertain ("This should either succeed or throw an appropriate validation error").

For a robust test, consider:

  1. Documenting the expected behavior explicitly (should it succeed with truncation, or fail validation?)
  2. If validation should fail, assert the specific exception type and HTTP status code
  3. If it should succeed, verify the name is handled correctly (truncated or stored as-is)

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 /tmp/ and use fsModule.unlinkSync(tempPath) for cleanup inside the try block. If any assertion fails between saveAs(tempPath) and unlinkSync(tempPath), the temp file will not be cleaned up.

Consider moving the cleanup to the finally block with a conditional check:

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...'.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@pmbrull pmbrull added the To release Will cherry-pick this PR into the release branch label Feb 4, 2026
@pmbrull pmbrull merged commit 6a1fb71 into main Feb 4, 2026
45 of 59 checks passed
@pmbrull pmbrull deleted the odcs-31-test branch February 4, 2026 14:10
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Changes have been cherry-picked to the 1.12.0 branch.

github-actions bot added a commit that referenced this pull request Feb 4, 2026
* TEST - Add Data Contract ODCS tests

* fix

* fix playwrights

* improve validations

* Update generated TypeScript types

* improve validations

* improve validations

* improve validations

* Add RBAC permission tests for ODCS Import/Export

- Add ODCSImportExportPermissions.spec.ts with comprehensive RBAC tests
- Test scenarios for Admin, Data Consumer, Data Steward roles
- Test scenarios for users with DataContract EditAll and ViewOnly permissions
- Test table owner permissions for importing contracts
- Test API-level permission enforcement (403 for unauthorized import)
- Verify export is allowed for users with view permissions
- Verify import buttons are hidden for users without Create/EditAll permissions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix schema validation type compatibility for ODCS imports

- Add type compatibility checking for schema validation that considers
  types within the same family as compatible (e.g., VARCHAR/STRING,
  BIGINT/INT, DOUBLE/NUMBER)
- Make type mismatches non-blocking for contract creation - they are
  tracked for informational purposes but don't fail validation
- Fix test assertions for ODCS type mapping (STRING logical type maps
  to ColumnDataType.STRING, not VARCHAR)
- Fix test assertions for null vs empty list handling in validation
  responses

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix ODCS Playwright test failures

- Fix SLA schema format in OM round trip test (timeUnit -> unit, lowercase values)
- Fix table ID reference (entity.id -> entityResponseData.id)
- Remove tests with incorrect assumptions about UI button visibility
  (permissions are enforced at API level, not by hiding UI elements)
- Remove Table Owner permission test (ownership doesn't grant DataContract Create permission)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Display type mismatch warnings in ODCS Import UI

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 <noreply@anthropic.com>

* improve validations

* Fix OM contract import showing ODCS validation errors

- 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 <noreply@anthropic.com>

* improve validations

* fix test

* Fix ODCS roles fixture to use correct field name

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 <noreply@anthropic.com>

* Fix ODCS merge mode test to check for correct role name

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 <noreply@anthropic.com>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
(cherry picked from commit 6a1fb71)
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

Copilot AI added a commit that referenced this pull request Feb 5, 2026
Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Feb 5, 2026
Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
chirag-madlani pushed a commit that referenced this pull request Feb 5, 2026
* Initial plan

* Revert MUITagSuggestion changes from PR #25588

Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>

* Revert test file changes from PR #25588

Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>

* fix test

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
Co-authored-by: karanh37 <karanh37@gmail.com>
karanh37 added a commit that referenced this pull request Feb 6, 2026
* Initial plan

* Revert MUITagSuggestion changes from PR #25588

Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>

* Revert test file changes from PR #25588

Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>

* fix test

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
Co-authored-by: karanh37 <karanh37@gmail.com>
(cherry picked from commit 2082da5)
mohityadav766 pushed a commit that referenced this pull request Feb 9, 2026
* Initial plan

* Revert MUITagSuggestion changes from PR #25588

Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>

* Revert test file changes from PR #25588

Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>

* fix test

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
Co-authored-by: karanh37 <karanh37@gmail.com>
mohityadav766 added a commit that referenced this pull request Feb 9, 2026
* use promote entity reindex in distributed

* Add Logs and finalize remaining entities

* fix nullpointer

* Fix Canonical Index Deletion

* Fix Test

* Optimize Reindexing

* Fix Default Recreate Handler

* Fix entity version history of dataProducts after removing inputPorts/ field (#25702)

* Fix: Use Downward API for pipelineRunId in standard K8s CronJobs (#25640)

When using the K8s pipeline client with useOMJobOperator=false, scheduled
pipelines (CronJobs) were failing because pipelineRunId was set to the
literal string "{{ omjob.uid }}" instead of a valid UUID.

This template syntax is designed for the OMJob operator to resolve at
runtime, but standard K8s CronJobs have no templating engine.

The fix uses the Kubernetes Downward API to inject the pod's own UID
(metadata.uid) as the pipelineRunId. Pod UIDs are valid UUIDv4 values
and unique per execution, making them suitable replacements.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* Rename deny list recognizer (#25698)

* Rename deny list recognizer

* Update generated TypeScript types

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix/testsuite cross suite result consistency (#25587)

* refactor: replace testCaseResultSummary with lastResultTimestamp in ES index

* feat: add lean batch SQL queries for test suite result summaries

* fix: recompute related test suite results on pipeline completion

* test: update UI sort field and tests for lastResultTimestamp

* Revert MUITagSuggestion changes from PR #25588 (#25710)

* Initial plan

* Revert MUITagSuggestion changes from PR #25588

Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>

* Revert test file changes from PR #25588

Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>

* fix test

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
Co-authored-by: karanh37 <karanh37@gmail.com>

* Fix Elasticsearch/OpenSearch field explosion with custom properties (#25627)

* Flatten Custom Properties

* Fix UI Side

* Fix Reindex matching old index conflict with alias

* Hacky wacky

* Review comments

* Add tests for custom properties to check field don't exceed

* Change to nested

* Align tests

* Fix Column and DataModel and subassets customProperties

* Fix extension updates

* Fix Description Updates

* Temp fix from other PR

* Fix Test failures

* Fix Review comments

* Fix Tests for playwright

* Import export improvements (#25542)

* Batched Import

* Batched Import

* Batched Import

* Optimised Internal methods for adding relationships for import, fixed circular dependency, generated changeEvents (#25582)

* Fix tag clearing and circular dependency detection in batch CSV imports

  - **Tag clearing fix**: Add deleteTagsByTarget before applying new tags in batch imports to match single entity import behavior, ensuring empty CSV fields properly clear existing
   tags
  - **Circular dependency detection fix**: Pre-track entities in dryRunCreatedEntities before parent resolution to enable proper circular reference validation during CSV team
  imports
  - Resolves test failures in TeamResourceIT.test_importCsv_circularDependency_trueRun and tag-related import issues
  - Maintains batch import performance while restoring pre-batch-import validation contracts

* improve storeRelationshipsInternal internal methods - make them truly batched operations

* - Add storeEntities override to all repositories (57 repos)
-  Add batch lock check to HierarchicalLockManager
- Add batch cache write to EntityRepository
-  Fix createManyEntitiesForImport with batched operations
- Fix updateManyEntitiesForImport with batched operations
-  Add change event creation in flushPendingEntityOperations

---------

Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com>

* have default implementation of storeEntities

* add batch relationship clearing while updating during import

* Fix column import failing for tables in same batch

 When importing CSV with batching, column rows failed to find their
  parent table because the table was queued but not yet persisted to DB.
  Added pendingEntityFQNs set to track entities in current batch. When
  processing columns, check if table is in this set - if so, add columns
  directly to the queued table object instead of creating a patch context.
  This ensures columns are persisted with the table in a single operation.

* fix UserResourceTest, TestCaseResourceIT

* Fix Circular Dependency Validation for GlossaryTerms

* Batch Insert ChangeEvents and Process Async

* fix: defer CSV result reporting until batch operations complete to ensure accuracy

* fix: ensure custom properties persist during batch CSV imports

* Fix rows processed count

* Fix: Moving of glossaryTerms to correctly detect update operation during import

* Increment version history

* fix TeamResourceTest

* Fix: Mutual Exclusivity Tag Validation during dry run, Deferring of failures

* Fix: Table Constraints Preservation on table import

* revert validateCsvString logic, needed for csv validation

* revert test changes

* Use dependency resolution to flush pending operations to find the parent

* fix search groping based on entityType in updateEntitiesBulk with tests

* Fetch original from db as cache takes some time to reload

* Test Cases

* Remove logs, fix TableResourceIT, Fix ChangeEvent Race Condition

---------

Co-authored-by: Ram Narayan Balaji <81347100+yan-3005@users.noreply.github.com>
Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com>
Co-authored-by: Ram Narayan Balaji <ramnarayanb3005@gmail.com>
Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
Co-authored-by: karanh37 <karanh37@gmail.com>

* fix: databricks view definition (#25700)

* Column Edit - Address feedback (#25669)

* Address Test feedback for columns

* Add Translations

* Fix count issue

* nit

* nit

* fix pagination control

* fix e2e test

---------

Co-authored-by: anuj-kumary <anujf0510@gmail.com>

* chore(ui): fix pagination tests (#25715)

* update table selectors

* modify selector

* feat(ui): Learning Resources page improvements and form updates (#25681)

* feat(ui): Learning Resources page improvements and form updates

* Improved footer component

* fix color code combination

* fix view more issue in card view

* Addressed card related feedback

* fix test

* fix playwright test

* nit

* nit

---------

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix pagination space between layout (#25728)

* Fix #25615 - Use system tables instead of API for lineage in UC (#25697)

* WIP - chore(ci): update playwright workflow to run ingestion with dataAsset… (#24753)

* chore(ci): update playwright workflow to run ingestion with dataAssetRules

* limit setup to required steps

* rearrnage spec files

* update condition

* update workflow

* update runners

* update console

* update config

* update arrangements

* fix typo

* rearrange specs

* remove unwanted import

* fix tests

* fix tests issues

* fix comment

* fix failing tests

* fix advance search

* fix test arrangements

* fix failing tests

* feat(ui): Remove resources count badge and add icon in left panel (#25735)

* Remove resources count badge and add icon in left panel

* nit

* Remove important from CSS

* Flaky(UI): Glossary import export  (#25693)

* fixed glossary import export flakyness

* removed timeout

* Flaky(UI) : Bulk import (#25653)

* fixed flaky bulk import

* fixed flaky bulk import

* formatted code

* removed unncessary loader await

* removed timeout

* Flaky(UI): Customize Detail Page spec (#25650)

* fixed customize detail page

* fixed button not clicking issue

* removed unncessary timeout

* added test id

* MINOR: use stats tables for MySQL and PSQL profiler (#25724)

* feat(system): use stats tables for mysl and psql profiler

* fix: skip tests if fail

* fix(trino): shadowing of http_scheme argument (#25726)

* fix(trino): shadowing of http_scheme argument

* fix: import chain

* fix: remove mock trino library

* [Search] Upgrade Clients (#25719)

* Upgrade Clients

* Update clients in docker files

* Fix Tests

* Fix integration test

* Fix Review Comments

* Fix More review comments :-
  1. ElasticSearchClient.java - Added keep-alive timeout configuration
  2. OpenSearchClient.java - Added keep-alive timeout configuration
  3. OpenMetadataOperations.java - Added logging for caught exception
  4. SigV4Hc5RequestSigningInterceptor.java - Now throws exception instead of silently returning

* Fix More review comments :-
  1. ElasticSearchClient.java - Added keep-alive timeout configuration
  2. OpenSearchClient.java - Added keep-alive timeout configuration
  3. OpenMetadataOperations.java - Added logging for caught exception
  4. SigV4Hc5RequestSigningInterceptor.java - Now throws exception instead of silently returning

Co-authored-by: mohityadav766 <mohityadav766@users.noreply.github.com>

* upgrade to 9.3.0 vs 3.4.0 server since earlier had bug

* fix version in pom

* Fix Review Comments

* FIX IAM OpenSearch FIx

---------

Co-authored-by: Gitar <noreply@gitar.ai>
Co-authored-by: mohityadav766 <mohityadav766@users.noreply.github.com>

* Fix Failing Test (#25745)

* Optimize Reindexing

* Fix Issue in Partition Worker

* Fix Entity Stats writing too much to db

---------

Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com>
Co-authored-by: IceS2 <pablo.takara@getcollate.io>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Eugenio <eugenio.donaque@getcollate.io>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adrià Manero <adria.estivill@getcollate.io>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: karanh37 <33024356+karanh37@users.noreply.github.com>
Co-authored-by: karanh37 <karanh37@gmail.com>
Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com>
Co-authored-by: Ram Narayan Balaji <81347100+yan-3005@users.noreply.github.com>
Co-authored-by: Ram Narayan Balaji <ramnarayanb3005@gmail.com>
Co-authored-by: Keshav Mohta <68001229+keshavmohta09@users.noreply.github.com>
Co-authored-by: anuj-kumary <anujf0510@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com>
Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
Co-authored-by: Dhruv Parmar <83108871+dhruvjsx@users.noreply.github.com>
Co-authored-by: Teddy <teddy.crepineau@gmail.com>
Co-authored-by: Gitar <noreply@gitar.ai>
Co-authored-by: mohityadav766 <mohityadav766@users.noreply.github.com>
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 To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants