Repository navigation
Conversation
|
@muyanli thanks for the PR. Could you please proivde a screen recording on how it looks in light and dark mode and also address the above bot comments cc @chirag-madlani for further review |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
|
Hi @harshach @chirag-madlani ! I have uploaded video to show the flow plus how it looks with dark mode. Also resolved the comments. Thank you! |
chirag-madlani
left a comment
There was a problem hiding this comment.
Left 1 comment and check CI failures, Thanks for the PR
| const loadArchitectureLayers = () => { | ||
| layersRequest ??= getSettingsByType(SettingType.LineageSettings) | ||
| .then( | ||
| (settings) => | ||
| (settings as LineageSettings).architectureLayers ?? NO_LAYERS | ||
| ) | ||
| .catch(() => { | ||
| layersRequest = undefined; | ||
|
|
||
| return NO_LAYERS; | ||
| }); | ||
|
|
||
| return layersRequest; | ||
| }; | ||
|
|
||
| /** For tests: forget the shared request. */ | ||
| export const resetArchitectureLayersRequest = () => { | ||
| layersRequest = undefined; | ||
| }; |
There was a problem hiding this comment.
We are already loading settings on a App load can't we use it?
There was a problem hiding this comment.
Good catch! App-mode routes render outside AppContainer, so the app-load settings were not there. I moved the app-load fetch into a shared useAppConfigurations hook. AppContainer and AppShell both call it. useArchitectureLayers now only reads appPreferences and does not fetch. As a side effect, app-shell pages now also get the saved lineage depth. This also fixes the browser test failures. The extra request had no MSW handler.
Move the app-start load of limits and lineage settings from AppContainer into a shared useAppConfigurations hook. AppShell calls it as well, since app-mode routes render outside AppContainer. useArchitectureLayers now only reads app preferences and no longer fetches settings itself.
Code Review ✅ Approved 🟡 Medium risk 5 closed / 5 findingsThe lineage overlay classifies assets and highlights backward or skipped edges from configured patterns and tags, so misconfiguration could mislead lineage interpretation. Adds an Architecture Layer overlay to the asset lineage canvas, driven by ordered layers configured in lineage settings by FQN pattern or tag, with layer stripes on nodes and warning-width edges for backward or layer-skipping links. Five review findings were resolved: layer-order warnings no longer override tracing dimming or hover/trace colours, the new label is translated in all locales, the layer tag uses the surface token, layer regexes are compiled once per configuration, and hovering a layered node keeps its layer stripe colour. No issues remain open. ✅ 5 closed✅ Bug: Layer-order warning undoes tracing dimming and hover/trace colour
✅ Quality: New label left in English in all 20 non-English locales
✅ Quality: Layer tag background uses page colour instead of surface token
✅ Performance: Every lineage node recompiles all layer regexes
✅ Edge Case: Hovering a layered node still turns its layer stripe brand blue
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Thanks for the review, @chirag-madlani!
The only red check is PR Metadata Validation. It needs #39598 in the Shipping project, and I don't have access. Could you add it please? Thank you! |
Describe your changes:
Fixes #39598
Phase 1 of #35872.
Many warehouses are built in ordered technical layers, such as medallion (
bronze→silver→gold) or Data Vault (staging → raw vault → business vault → marts), and data is expected to move forward through them. Lineage can group assets by service, domain or data product, but nothing shows which layer an asset is in, or flags lineage that runs against the layer order.#35872 asks for this. This PR is its first phase: it marks layers on the asset lineage canvas and flags edges that break the order. The Lineage Map rollup by layer, which the issue centres on, needs server-side work and comes in a later phase.
This PR lets admins describe their layers once in lineage settings, by name patterns or by tags (such as
dbtTags.layer_*from dbt), and adds an Architecture Layer overlay to the asset lineage canvas, next to Column and Observability. When it is on:The overlay is offered only once layers are configured, so nothing changes for anyone who doesn't use it.
Type of change:
High-level design:
Configuration (
lineageSettings.json, recorded inADR:2026-12-02-lineage-architecture-layers-are-ordered-groups-matched-by-fqn-or-tag)lineageSettingsgets an optionalarchitectureLayersarray. Its order is the layer order. Each layer has a uniquename, an optionalcolor(#rrggbb), andfqnPatterns,tagsor both:*matches any run of characters, dots included, and?matches one character. Since an FQN isservice.database.schema.name, one rule kind covers layering by service, database, schema or name prefix, for every entity type.dbtTags.layer_*tags dbt ingestion creates; the tags give membership and the layer list gives the order tags lack.LineageLayergets anArchitectureLayervalue, so the overlay can also be chosen as the default layer in lineage settings.Edge rule. An edge is judged only when both ends have a layer. With
ithe upstream layer's position andjthe downstream one's:j < i: backward (e.g. gold → bronze);j > i + 1: skipped layer (e.g. bronze → gold);Column edges are not judged separately; the table edge they belong to carries the warning.
UI. The overlay follows how the Observability layer is built, so it adds no new mechanism:
utils/Lineage/architectureLayer.utils.ts: pure functions for glob → RegExp, the layer matcher on an asset's FQN and tags (patterns are compiled once per configuration, not per node), the edge rule, the edges with a layer-order issue (each end read from its canvas node, which carries the asset's tags), and the layer colour (a default palette for layers without one).getLineagealready returns each node's tags (the search documents' source fields), so no API change is needed;getNodeLineageDatanow keepstagswhen it trims a lineage node for the canvas.hooks/lineage/useArchitectureLayers.ts: reads the configured layers from app preferences, and whether the overlay is on.hooks/useAppConfigurations.ts: the app-start load of limits and lineage settings, moved out ofAppContainer.AppShellcalls it too, because app-shell pages render outsideAppContainer.LineageLayers.tsx: adds the overlay to the asset layer menu when layers are configured. The newlabel.architecture-layeris translated in every locale.useLineageStore.setActiveLayerclears the platform view for it, as it does for the other overlays.CustomNodeV1+ArchitectureLayerTag: the layer color goes to the node's top border through a CSS variable, and the tag floats on that border at the right, so it doesn't change the node height the layout uses and doesn't cover the Base badge. The stripe stays when a node is traced, selected or hovered, since those states recolour the whole border and the layer matters most while a path is traced. The tag uses the card's surface token, so it matches the card in dark mode. Scene (container) nodes are skipped.CanvasEdgeRenderer/useCanvasEdgeRenderer: computes the issue edges;withLayerOrderWarning(EdgeStyleUtils) draws them at twice the normal width and, unless the edge is hovered, selected or traced, inlayerOrderWarning(warning-600). Hovered, selected and traced edges keep their emphasis colour, and tracing still dims warning edges off the path. The wider stroke stays in every state, so the warning does not rely on colour alone. Dashes were not used because a dashed edge already means the edge has a pipeline. A failing data quality highlight still wins over a layer-order warning. The default layer palette leaves out oranges and browns, which would read like the warning. Layer colors and the warning colors use theme tokens, so they follow dark mode.Alternatives considered
lineage/sceneAPI, so it needs backend work; it is planned as a later phase rather than mixed into this one.Compatibility.
architectureLayersis optional, so existing settings stay valid and no migration is needed. Both lineage settings forms already send back the fields they don't edit, so saving them keeps the configured layers. Until a layers editor lands (phase 2), layers are set throughPUT /api/v1/system/settings.Next phases (separate PRs)
lineage/scene.Tests:
Use cases covered
Unit tests
utils/Lineage/architectureLayer.utils.test.ts: glob matching (*across dots,?, case, literal special characters), tag matching (case, first layer wins across patterns and tags), unmatched nodes, the backward / skipped edge rule, issue edges (column edges skipped, layers read from node tags), default colours.utils/EdgeStyleUtils.test.ts: warning edges are drawn in the warning colour and wider; a failing data quality edge keeps its style.utils/EntityLineageNodeUtils.test.ts: lineage nodes keep their tags (fails without the change).hooks/lineage/useArchitectureLayers.test.ts: layers from app preferences; off when the overlay is not active; no layers before settings load.hooks/useAppConfigurations.test.ts: loads lineage settings into app preferences once the user is known.AppShell.test.tsx: the shell loads the app configuration.ArchitectureLayerTag.test.tsx,LineageLayers.test.tsx(overlay offered only with configured layers, toggling it).Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Flow/LineageSettings.spec.ts› Architecture Layer overlay tags nodes with their layer by FQN pattern or tag: tags the topic, sets layers through the settings API (the table by FQN pattern, the topic by tag), turns on the overlay and checks each node's layer tag, then restores the settings.Full run: 824 passed, 21 failed (16 timeouts). The failures are Domain tests on all entity types and a few others. They also fail without this change, and they pass when run alone. Lineage specs pass.
Manual testing performed
./docker/run_local_docker.sh -m no-ui -d mysql -i falseand ran the UI withyarn start.acme_lakehouse.analyticswithbronze,silver,gold,reportingandsandboxschemas, lineage between its tables, and adbtTags.layer_marttag onreporting.revenue_finance_mart. Set layers throughPUT /api/v1/system/settings: bronze / silver / gold by schema pattern (plusraw_*,dim_*,fact_*for the sample data), and marts by the dbt tag.gold.fct_revenue's Lineage tab, turned on Architecture Layer: each table shows its layer,revenue_finance_martshows marts from its tag,sandbox.revenue_adhocshows none, andraw_payments → fct_revenue(skips silver) andfct_revenue → finance_reconciliation(gold → silver) are drawn as warnings. Turning the overlay off restores the canvas.UI screen recording:
after_feature.mp4
Checklist:
I have read CONTRIBUTING.md (the pre-review gate) and the contributor docs.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.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. (Optional field; see Compatibility.)
For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.mdand fixed every 🔴 finding, or answered it on the line below.Decision check: adds
ADR:2026-12-02-lineage-architecture-layers-are-ordered-groups-matched-by-fqn-or-tagfor thearchitectureLayersformat, the matching rule and the edge rule.I have added tests around the new logic.