Skip to content

nebw #3: domains <-> UC governed tags, bidirectional - #737

Draft
larsgeorge-db wants to merge 2 commits into
nebw-bugfixesfrom
nebw-domain-uc-sync
Draft

larsgeorge-db wants to merge 2 commits into
nebw-bugfixesfrom
nebw-domain-uc-sync

Conversation

@larsgeorge-db

Copy link
Copy Markdown
Collaborator

Summary

nebw feature #3: represent Ontos data domains as Databricks Discover governed tags and import them back, bidirectionally.

Grounded in a verified 2026 constraint: Discover Domains are layered on governed tags — there is no public API to create a Discover Domain card and no native "this tag is a domain" flag. So the programmatic contract is the governed-tag key/value convention Discover reads ({domain}, {parent}/{subdomain}); the domain card itself stays a documented manual UI step.

Base is nebw-bugfixes (stacked on PR #735).

Changes

Sharedsrc/common/governed_tags.py: pure key/value convention, parse, and parent-before-subdomain ordering helpers (fully unit-tested).

Outbound (uc_tag_sync job): when use_governed_domain_tag is set (yaml default on), sync the domain as the databricks_domain governed tag with the Discover convention, replacing the plain ontos_data_domain_name tag. Domain read SQL now joins the parent domain so subdomains emit {parent}/{subdomain}. The convention is inlined in the standalone cluster job and mirrored by the shared module.

Inbound (app-side) — DomainUcSyncManager: parse governed-tag values → create/exists proposals (auto-inserting missing parents, deduped, ordered), open an Asset Review for approval (per decision), and apply an approved import idempotently (parents before subdomains). Routes: POST /data-domains/import-from-uc/{preview,review,apply}.

Fix: create_domain_internal did not stringify a UUID parent_id / caller id for the String PK columns (broke under SQLite) — corrected, consistent with create_domain.

Testing

49 unit tests across the helper, inbound manager, outbound job (stubbed pyspark import), and the domain repository. Broad domain + version suites green, no regressions.

Decisions applied

  • Outbound replaces the plain domain tag with the governed-tag convention.
  • Inbound is Asset Review-gated before writing.
  • Subdomain import auto-creates missing parents.

Follow-ups (documented, not in this PR)

  • A UC reader that discovers domain governed-tag values (information_schema / entity tag assignments) to feed the import endpoints (they currently take tag_values in the body).
  • Discover Domain card creation (manual UI; no API).

Note

Push used SKIP_SECRET_SCAN=1 for the same pre-existing historical secrets already on main/development (see #735); none are new in this branch.

Represent Ontos data domains as Databricks Discover governed tags and import
them back, per the verified constraint that Discover Domains are layered on
governed tags (no domain-card API, no native domain flag).

Outbound (uc_tag_sync job): when use_governed_domain_tag is set, emit the
domain as the 'databricks_domain' governed tag with the Discover key
convention -- '{domain}' for top-level, '{parent}/{subdomain}' for subdomains
-- replacing the plain ontos_data_domain_name tag. The domain read SQL now
joins the parent domain; the yaml default enables the flag. The convention is
inlined in the job (ships to the cluster as a standalone file) and mirrored by
the shared, tested src/common/governed_tags.py.

Inbound (app-side): DomainUcSyncManager parses governed-tag values into
create/exists proposals (auto-inserting missing parents, deduped, ordered
parents-before-subdomains), opens an Asset Review for approval, and applies an
approved import idempotently. Routes: POST /data-domains/import-from-uc/
{preview,review,apply}.

Also fixes a latent bug in create_domain_internal: it did not stringify a UUID
parent_id / caller id for the String PK columns (broke under SQLite).

Discover Domain *card* creation stays a manual UI step; a UC reader to feed the
import endpoints is a documented follow-up. See docs/plans/nebw-domain-uc-sync.md.

Session: claude -r 01d95399-c840-4b99-b76c-735490295c66
Session: claude -r 01d95399-c840-4b99-b76c-735490295c66
@larsgeorge-db
larsgeorge-db requested a review from a team as a code owner August 19, 2026 19:04
@larsgeorge-db
larsgeorge-db marked this pull request as draft September 14, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant