Skip to content

Fixes open-metadata/openmetadata-collate#9337: Add Purview curated metadata contract - #39887

Open
harshach wants to merge 4 commits into
mainfrom
agent/purview-metadata-registration
Open

harshach wants to merge 4 commits into
mainfrom
agent/purview-metadata-registration

Conversation

@harshach

@harshach harshach commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes open-metadata/openmetadata-collate#9337

Registers the Purview metadata-service type and its connection schema for Collate's curated-metadata migration connector. That is the whole change: MetadataServiceType gains Purview, metadataConnection references the new connections/metadata/purviewConnection.json, and the generated TypeScript/UI schema files are regenerated from it. One line in ServiceUtilClassBase marks Purview unsupported in the OSS service picker, as Collibra is, because OSS has no Purview source.

Everything else lives in Collate (#9338): the source, the test-connection definition, the UI schema loader, and all reads and writes, which go through the Python SDK. This PR makes no ingestion, server or UI runtime change.

Draft: merges ahead of the Collate PR, which advances its submodule onto this contract.

Type of change:

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

High-level design:

  • The connection schema models Entra client-secret/certificate authentication, the Data Map and Unified Catalog toggles, dry-run, overwrite, and explicit existing-asset mapping rules. Python mapping patterns are validated by the source, avoiding JavaScript's incompatible named-group syntax.
  • Alternatives considered: defining the connection only in Collate fails workflow and server validation at the upstream metadataConnection union, which is why Alation and Collibra are registered the same way.
  • Decision record: ADR:openmetadata-collate/2026-12-04-purview-curated-metadata-migration records the ownership split; no OpenMetadata record is needed for an additive service type.

Tests:

  • Schema and generated-code only; no behavior to unit-test here. The Collate PR tests the source, the test-connection definition and the UI loader.
  • python3 scripts/check_generated_models.py --check — up to date (unchanged since the previous push).
  • mvn clean install -pl openmetadata-spec passed for the generated Java contract (unchanged since the previous push).
  • Manual: the Collate example purview.yaml parses through the regenerated WorkflowSource into PurviewConnection with dryRun=True.

Checklist:

  • I have read CONTRIBUTING.md and the contributor docs.
  • My PR is linked to open-metadata/openmetadata-collate#9337.
  • For JSON Schema changes: no migration is needed; this is an additive service type and connection schema.
  • UI recording is not applicable: Purview is hidden from the OSS service picker.

Project metadata: the current token lacks project-write scope, so issue #9337 still needs its Shipping fields set by a maintainer.

harshach and others added 2 commits December 5, 2026 09:45
The Collate Purview source patches through the SDK with its own allowlist,
so the shared ingestion sink allowlist does not need to change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Collate connector owns the UI loader, test-connection definition and
tests. OpenMetadata keeps only the MetadataServiceType entry, the connection
schema with its generated code, and the OSS unsupported-service entry so the
open-source picker does not offer a connector it cannot run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gitar-bot

gitar-bot Bot commented Dec 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 2 closed / 2 findings

Adding the Purview service type and credential-bearing connection schema changes shared contracts, potentially affecting service configuration and credential handling.

Adds the shared Purview metadata-service contract and connection schema for Collate's curated-metadata migration, with no ingestion runtime change. Resolved: the shared patch allowlist no longer lets every connector strip asset domains, and Purview defaults and limits are now recorded in the ADRs. No open issues found.

✅ 2 closed
✅ Bug: Shared allowlist now lets every connector strip asset domains

📄 ingestion/src/metadata/ingestion/models/patch_request.py:93-99 📄 docs/decisions/2026-12-04-purview-is-a-collate-curated-metadata-contract.md:17
ALLOWED_COMMON_PATCH_FIELDS isn't specific to Purview. The metadata_rest sink uses it for every connector's PATCH. TopologyRunner.create_patch_request builds new_entity = original_entity.model_copy(update=create_request.__dict__), and the original is fetched with fields=["*"]. Create requests like CreateTable and CreateDashboard have a domains field that holds a list of FQN strings and is usually None. With exclude_none=True, the destination dump leaves domains out while the source still has the server's references. So once domains is allowed, jsonpatch emits remove /domains. domains is not in RESTRICT_UPDATE_LIST, so that remove goes through. The result: every re-run of an ordinary database or dashboard connector erases domains that users assigned in the UI. When a connector does set domains, it sends raw FQN strings where the API expects EntityReferences. The ADR's rule that "sources must merge retained values" doesn't hold for the generic topology path. The fix is to keep the governance fields out of the common allowlist and pass a Purview-specific allowlist from the Collate source, or at least add domains (and the other new fields) to RESTRICT_UPDATE_LIST. Add a test that runs a Table-plus-CreateTable patch through create_patch_request.

✅ Quality: Purview defaults and limits aren't recorded in any ADR here

📄 openmetadata-spec/src/main/resources/json/schema/entity/services/connections/metadata/purviewConnection.json:99-113 📄 docs/decisions/2026-12-04-purview-is-a-collate-curated-metadata-contract.md:19
The schema sets several defaults and caps that were judgment calls: identityLimit (default 100000, max 1000000), pageSize (100/1000), requestTimeoutSeconds (60/300), maxRetries (5/10), and dryRun defaulting to true. The new ADR hands "dry-run, merge and API-version choices" to a record in openmetadata-collate. No record in docs/decisions/ states these limits, and this repo owns the contract. The ADR should say something like: "Purview connections default to dryRun=true, index at most 100,000 users plus teams for identity resolution, page at 100 items, time out requests after 60s, and retry up to 5 times." It should also give the reason for each value.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@harshach
harshach marked this pull request as ready for review December 6, 2026 00:27
@harshach
harshach requested a review from a team as a code owner December 6, 2026 00:27
@harshach
harshach requested review from karthicksharan and removed request for a team December 6, 2026 00:27
@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • Linked issue open-metadata/openmetadata-collate#9337 does not exist or is not accessible.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

"title": "Entra Application Client ID",
"type": "string"
},
"authType": {

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.

This oneOf looks like it's missing a converter in ClassConverterFactory, and the failing NestedSecretConverterCoverageTest in CI says the same. Without one, the authType secrets get stored unencrypted. Copying MicrosoftFabricConnectionClassConverter as PurviewConnectionClassConverter and registering it should fix it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants