Skip to content

Phase 1 stack #2: ADF discovery — inventory + lineage + motifs - #94

Open
matthewmoorcroft wants to merge 3 commits into
discovery/shared-ast-standardfrom
stack/adf-discovery
Open

matthewmoorcroft wants to merge 3 commits into
discovery/shared-ast-standardfrom
stack/adf-discovery

Conversation

@matthewmoorcroft

@matthewmoorcroft matthewmoorcroft commented Sep 16, 2026

Copy link
Copy Markdown
Member

Part of the Phase 1 stack. Stacked on #84 (shared source AST). Base: discovery/shared-ast-standard.

What this adds

Maps ADF onto the shared source AST and builds the unified inventory.json from that AST, with control + data lineage and additive motifs. (Content of the former #79/#80/#81/#90.)

  • sources/adf/discovery_mapping.py — AST → SourceGraph (1:1, source-faithful, no collapse)
  • sources/adf/loader.py — inventory built from the discovery AST
  • sources/adf/dataset_lineage.py — ADF dataset → DataAsset (identity/signature)
  • discovery_inventory.py — source-agnostic inventory emitter + additive per-pipeline motifs[]

Schema added (all additive; existing consumer keys byte-compatible)

  • top-level source; per-activity original_type, structured dependencies (with conditions), verbatim raw
  • per-pipeline lineage block: control_edges, data_edges
  • per-pipeline motifs[]: motif_id, member_task_keys, databricks_replacement, confidence_notesdecoupled from lineage; discover does not collapse (the routing capability signal)

matthewmoorcroft and others added 3 commits September 16, 2026 17:24
Map ADF exports onto the shared source-neutral discovery AST and emit a
source-agnostic inventory, populate control/data lineage (Switch-aware),
surface detected ADF motifs additively in the inventory, and carry the
lineage/motif tags on the IR (data_reads/data_writes, motif_id on the
Activity base; pipeline lineage block) with matching serialization.

Consolidates PRs #79 (ADF -> shared source AST + inventory emitter),
#80 (data/control lineage + Switch-aware walking), #81 (emit lineage into
inventory.json) and #90/#64 (motif detection + exact-duplicate dedupe),
plus the coverage golden.

Co-authored-by: Isaac <no-reply@databricks.com>
FIX 1: When ADF discover parses zero pipelines (e.g. --source-dir pointed at a
directory of ARM templates with no recognized pipelines/ layout), emit a loud
stderr warning instead of finishing with a success-shaped "Loaded 0
pipeline(s)". The warning steers the operator to pass the ARM template as the
file path or supply the expected export layout. Exit code for the 0-pipeline
case is unchanged (still 0); behaviour for valid dirs/files is untouched.

FIX 7: Label the discover summary's "Total activities" count as raw activities
including nested, and note that convert reports top-level task-units after motif
collapse, so the smaller convert number is not mistaken for a discrepancy.
Console-output only -- inventory.json keys are byte-compatible (unchanged).

Co-authored-by: Isaac <no-reply@databricks.com>
Cross-review (non-blocking): the loud 0-pipeline warning referenced the loader's
internal --source-dir flag, but that is not what a user passes -- the discover
runner takes --adf-source-path (the generic --source-path alias normalises to
--source-dir internally). Name --adf-source-path in the guidance so the operator
is pointed at the flag they actually use. Test asserts the user-facing flag is
named and the internal one is not.

Co-authored-by: Isaac <no-reply@databricks.com>

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.

1 participant