Repository navigation
Fix lineage authorization in MCP tools - #32437
Conversation
…ntegration coverage
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
…d nodes separately
Code Review ✅ Approved 2 resolved / 2 findingsFixes entity-scoped authorization in MCP lineage tools by authorizing against the requested entity's FQN, filtering nodes individually by ✅ 2 resolved✅ Bug: neighbours() omits domain-pruned nodes from hiddenNodes count
✅ Quality: hiddenUnchecked note overstates the 'unchecked' node count
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 809 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 48m 26s ⏱️ Max setup 6m 12s · max shard execution 17m 42s · max shard-job elapsed before upload 21m 16s · reporting 4s 🌐 225.56 requests/attempt · 2.66 app boots/UI scenario · 17.80% common-shard skew Optimization targets still in progress:
How to debug locally |
* fix(mcp): authorize lineage tools against the requested entity * fix(mcp): make the lineage permission filter fail closed and batch its checks * test(mcp): cover pipeline redaction and temp-table SQL gating in lineage edges * fix(mcp): withhold lineage pipelines that cannot be identified, add integration coverage * gitarbot feedback: count domain-pruned neighbours and report unchecked nodes separately (cherry picked from commit eae0911)
* fix(mcp): authorize lineage tools against the requested entity * fix(mcp): make the lineage permission filter fail closed and batch its checks * test(mcp): cover pipeline redaction and temp-table SQL gating in lineage edges * fix(mcp): withhold lineage pipelines that cannot be identified, add integration coverage * gitarbot feedback: count domain-pruned neighbours and report unchecked nodes separately
* fix(mcp): authorize lineage tools against the requested entity * fix(mcp): make the lineage permission filter fail closed and batch its checks * test(mcp): cover pipeline redaction and temp-table SQL gating in lineage edges * fix(mcp): withhold lineage pipelines that cannot be identified, add integration coverage * gitarbot feedback: count domain-pruned neighbours and report unchecked nodes separately
Describe your changes:
Fixes #31941
get_entity_lineagechecked permissions without loading the asset first. Any policy rule that looksat tags, owners or domains therefore got the same answer for every asset — so a rule meant to allow
one table ended up blocking all of them (or none).
What changed:
get_entity_detailsalready doestempLineageTablesonly withincludeSql=true, since they come from the SQLroot_cause_analysisis left alone on purpose. It returns the same kind of node names, so it needsthe node filtering as well, not just the permission fix. Doing that separately.
Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
hiddenNodessays 1Unit tests
LineagePermissionFilterTest— admin skip, bots not skipped, denied nodes dropped, over-limitnodes hidden instead of returned,
canViewallow/deny/errorLineageGraphPrunerTest— pruning leaves no dangling edges, drops nodes cut off behind a hidden oneGetLineageToolTest— pipeline hidden and shown,tempLineageTablesgatingRuleEvaluatorTest— a permission check with no asset loaded reads a present tag as missing (theoriginal cause)
Backend integration tests
McpIntegrationITfor the cases above.Ran:
openmetadata-mcp589 tests,McpIntegrationIT12, REST lineage ITs 140, servicelineage/policy units 54.
mvn spotless:checkclean.