OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

fix(EntityUtilClassBase): add INGESTION_PIPELINE case to getEntityLink

Open Vishnuujain opened this issue 5 months ago โ€ข 6 comments

Summary

  • INGESTION_PIPELINE had no case in getEntityLink and fell through to the TABLE default, producing a 404 when clicking pipeline entity links in chat messages
  • Extracts the parent service name from the first FQN segment and routes to /service/databaseServices/<serviceName>/ingestion
  • Service category defaults to databaseServices (most common); subclasses can override for a more precise route

๐Ÿค– Generated with Claude Code


Summary by Gitar

  • Routing improvements:
    • Added INGESTION_PIPELINE case to getEntityLink to support direct navigation.
    • Implemented routing to getLogsViewerPath to avoid service-specific 404 errors for pipeline entities.
  • Parsing and link resolution:
    • Updated EntityMarkdownLink to handle serviceCategory and serviceFqn extraction for INGESTION_PIPELINE.
    • Added URL decoding support and robust validation for pipeline link segments in parseEntityLink.
  • Testing:
    • Added unit tests in EntityMarkdownLink.test.tsx to verify correct path resolution and parameter propagation for pipeline links.

This will update automatically on new commits.

------|----------| | openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts | Adds INGESTION_PIPELINE case to getEntityLink, routing to the logs viewer page via getLogsViewerPath using the pipeline FQN โ€” service-type agnostic and correct for all pipeline service categories. |

Reviews (3): Last reviewed commit: "fix(EntityUtilClassBase): route INGESTIO..." | Re-trigger Greptile

Greptile Summary

This PR fixes a 404 when clicking ingestion pipeline entity links embedded in chat/markdown messages by adding an INGESTION_PIPELINE case to getEntityLink and a corresponding parse branch in EntityMarkdownLink that extracts serviceCategory and serviceFqn from a structured href format.

  • EntityMarkdownLink.tsx: parses #ingestionPipeline/{serviceCategory}/{serviceFqn}/{pipelineFqn} hrefs and threads the extracted fields through to getEntityLink.
  • EntityUtilClassBase.ts: routes INGESTION_PIPELINE through getLogsViewerPath; however the serviceCategory ?? EntityType.INGESTION_PIPELINE fallback means any caller that omits serviceCategory (e.g. prepareFeedLink in FeedUtilsPure.ts) now produces a logs-path URL that gets /activity_feed appended โ€” a path that matches no route.
  • EntityMarkdownLink.test.tsx: adds coverage for the new parse path.

Confidence Score: 4/5

Safe to merge for the markdown-link use case; breaks activity-feed navigation for ingestion pipeline entities from other callers.

The markdown link fix works correctly when serviceCategory is supplied. The concern is that getEntityLink is also called by prepareFeedLink (and other utilities) without a serviceCategory, and those callers now receive a /logs-suffixed URL instead of the previous table-detail fallback. prepareFeedLink appends /activity_feed to the result, producing a path that has no router match, causing navigation to fail silently for any ingestion pipeline activity feed entries.

EntityUtilClassBase.ts โ€” the INGESTION_PIPELINE case and its fallback need a second look relative to callers that do not provide serviceCategory.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts Adds INGESTION_PIPELINE case to getEntityLink routing to getLogsViewerPath; the fallback serviceCategory of EntityType.INGESTION_PIPELINE breaks activity-feed URL generation for pipeline entities.
openmetadata-ui/src/main/resources/ui/src/components/common/MarkdownEditor/EntityMarkdownLink/EntityMarkdownLink.tsx Adds structured parse path for INGESTION_PIPELINE hrefs (serviceCategory/serviceFqn/pipelineFqn segments); correctly passes all fields to getEntityLink.
openmetadata-ui/src/main/resources/ui/src/components/common/MarkdownEditor/EntityMarkdownLink/EntityMarkdownLink.interface.ts Adds optional serviceCategory and serviceFqn fields to EntityLinkInfo; clean additive change.
openmetadata-ui/src/main/resources/ui/src/components/common/MarkdownEditor/EntityMarkdownLink/EntityMarkdownLink.test.tsx Adds coverage for the new INGESTION_PIPELINE parse path; tests verify argument threading but use a mock that returns a different URL format than the real implementation generates.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant MD as EntityMarkdownLink
    participant PE as parseEntityLink
    participant EU as EntityUtilClassBase.getEntityLink
    participant LV as getLogsViewerPath
    participant AF as prepareFeedLink (FeedUtilsPure)

    MD->>PE: "href="#ingestionPipeline/databaseServices/svc/pipe-uuid""
    PE->>PE: split rest into [serviceCategory, serviceFqn, ...fqnParts]
    PE-->>MD: "{entityType, fullyQualifiedName, serviceCategory, serviceFqn}"
    MD->>EU: getEntityLink(INGESTION_PIPELINE, fqn, ..., serviceCategory, serviceFqn)
    EU->>LV: getLogsViewerPath(serviceCategory, fqn, fqn)
    LV-->>MD: "/databaseServices/{encodedFqn}/logs โœ…"

    Note over AF,EU: โš ๏ธ Different call path โ€” no serviceCategory
    AF->>EU: getEntityLink("ingestionPipeline", entityFQN)
    EU->>LV: getLogsViewerPath("ingestionPipeline", fqn, fqn)
    LV-->>AF: "/ingestionPipeline/{encodedFqn}/logs"
    AF->>AF: append /activity_feed
    AF-->>AF: "/ingestionPipeline/{encodedFqn}/logs/activity_feed โŒ no route match"
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant MD as EntityMarkdownLink
    participant PE as parseEntityLink
    participant EU as EntityUtilClassBase.getEntityLink
    participant LV as getLogsViewerPath
    participant AF as prepareFeedLink (FeedUtilsPure)

    MD->>PE: "href="#ingestionPipeline/databaseServices/svc/pipe-uuid""
    PE->>PE: split rest into [serviceCategory, serviceFqn, ...fqnParts]
    PE-->>MD: "{entityType, fullyQualifiedName, serviceCategory, serviceFqn}"
    MD->>EU: getEntityLink(INGESTION_PIPELINE, fqn, ..., serviceCategory, serviceFqn)
    EU->>LV: getLogsViewerPath(serviceCategory, fqn, fqn)
    LV-->>MD: "/databaseServices/{encodedFqn}/logs โœ…"

    Note over AF,EU: โš ๏ธ Different call path โ€” no serviceCategory
    AF->>EU: getEntityLink("ingestionPipeline", entityFQN)
    EU->>LV: getLogsViewerPath("ingestionPipeline", fqn, fqn)
    LV-->>AF: "/ingestionPipeline/{encodedFqn}/logs"
    AF->>AF: append /activity_feed
    AF-->>AF: "/ingestionPipeline/{encodedFqn}/logs/activity_feed โŒ no route match"

Reviews (6): Last reviewed commit: "Update openmetadata-ui/src/main/resource..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Vishnuujain avatar Jun 22 '26 12:06 Vishnuujain

โŒ PR checklist incomplete

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

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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.

github-actions[bot] avatar Jun 22 '26 12:06 github-actions[bot]

Hi there ๐Ÿ‘‹ Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

github-actions[bot] avatar Jun 22 '26 12:06 github-actions[bot]

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
63.05% (70467/111758) 45.88% (40621/88534) 47.32% (12571/26565)

github-actions[bot] avatar Jun 22 '26 12:06 github-actions[bot]

๐ŸŸก Playwright Results โ€” all passed (71 flaky)

โœ… 4415 passed ยท โŒ 0 failed ยท ๐ŸŸก 71 flaky ยท โญ๏ธ 37 skipped

Shard Passed Failed Flaky Skipped
๐ŸŸก Shard 1 381 0 6 11
๐ŸŸก Shard 2 801 0 16 8
๐ŸŸก Shard 3 815 0 6 7
๐ŸŸก Shard 4 810 0 2 10
๐ŸŸก Shard 5 836 0 29 0
๐ŸŸก Shard 6 772 0 12 1
๐ŸŸก 71 flaky test(s) (passed on retry)
  • Features/DataAssetRulesDisabled.spec.ts โ€บ Verify the SearchIndex entity item action after rules disabled (shard 1, 1 retry)
  • Features/Glossary/GlossaryPagination.spec.ts โ€บ should check for nested glossary term search (shard 1, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts โ€บ verify create lineage for entity - Topic (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts โ€บ User without permission (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts โ€บ a fully denied user sees neither asset type when browsing (shard 1, 2 retries)
  • Flow/SearchRBAC.spec.ts โ€บ the browse tree only shows the asset-type categories a user can access (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts โ€บ Glossary (shard 2, 2 retries)
  • Features/BulkImport.spec.ts โ€บ Database service (shard 2, 1 retry)
  • Features/BulkImport.spec.ts โ€บ Database Schema (shard 2, 1 retry)
  • Features/BulkImport.spec.ts โ€บ Table (shard 2, 1 retry)
  • Features/BulkImportWithDotInName.spec.ts โ€บ Column with dot in name under service with dot (shard 2, 1 retry)
  • Features/Container.spec.ts โ€บ Container page should show Schema and Children count (shard 2, 1 retry)
  • Features/Container.spec.ts โ€บ Container page children pagination (shard 2, 1 retry)
  • Features/Container.spec.ts โ€บ expand / collapse should not appear after updating nested fields for container (shard 2, 1 retry)
  • Features/Container.spec.ts โ€บ Copy column link button should copy the column URL to clipboard (shard 2, 1 retry)
  • Features/ContextCenter.spec.ts โ€บ clicking a memory row opens the view-only modal (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts โ€บ Admin: Complete export-import-validate flow (shard 2, 2 retries)
  • Features/DomainFilterQueryFilter.spec.ts โ€บ 3-level domain hierarchy: SubSubDomain assets visible when SubDomain selected (shard 2, 1 retry)
  • Features/DomainFilterQueryFilter.spec.ts โ€บ Multi-nested domain hierarchy: filters should scope correctly at every level (shard 2, 1 retry)
  • Features/ExploreFilterComposition.spec.ts โ€บ glossary term filter spans asset types and ANDs with tier (shard 2, 1 retry)
  • Features/ExploreQuickFilters.spec.ts โ€บ explore tree sidebar selection is not cleared when a top dropdown filter is applied (shard 2, 1 retry)
  • Features/GlobalPageSize.spec.ts โ€บ Page size should persist across different pages (shard 2, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts โ€บ Rich Text Editor - Text Formatting (shard 3, 1 retry)
  • Features/Permissions/EntityPermissions.spec.ts โ€บ Dashboard allow entity-specific permission operations (shard 3, 1 retry)
  • Features/RecentlyViewed.spec.ts โ€บ Check Container in recently viewed (shard 3, 1 retry)
  • Features/SearchExport.spec.ts โ€บ Export queues a background job and downloads from the jobs tray (shard 3, 1 retry)
  • Features/SearchIndexNestedColumns.spec.ts โ€บ 25-level oversized nested column indexes and is searchable by its deep column name (shard 3, 2 retries)
  • Features/Topic.spec.ts โ€บ Topic page should show schema tab with count (shard 3, 1 retry)
  • Flow/NestedChildrenUpdates.spec.ts โ€บ should add and remove tags to nested column immediately without refresh (shard 4, 1 retry)
  • Flow/NestedChildrenUpdates.spec.ts โ€บ should add and remove tags to nested column immediately without refresh (shard 4, 2 retries)
  • ... and 41 more

๐Ÿ“ฆ Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

github-actions[bot] avatar Jun 22 '26 15:06 github-actions[bot]

Code Review โœ… Approved 3 resolved / 3 findings

Adds INGESTION_PIPELINE routing to resolve navigation 404s, while addressing FQN splitting and path fallback logic issues. Automated tests were updated to verify the new link resolution behavior.

โœ… 3 resolved
โœ… Edge Case: FQN split with '.' breaks on quoted service names

๐Ÿ“„ openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts:462-465 fullyQualifiedName.split('.')[0] naively splits on the first dot. OpenMetadata FQNs quote segments that themselves contain dots, e.g. a service named my.service is serialized as "my.service".pipeline. In that case .split('.')[0] returns "my (with a stray quote and truncated name), producing a broken service route. The codebase already provides Fqn.split (from ./Fqn), which uses an ANTLR4 grammar to correctly parse quoted FQN segments and is used elsewhere (e.g. FqnUtils.ts) for exactly this purpose. Use it here to extract the first segment safely.

โœ… Quality: Dead ?? fullyQualifiedName fallback after String.split

๐Ÿ“„ openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts:462-463 String.prototype.split always returns an array with at least one element (for an empty input it returns ['']), so fullyQualifiedName.split('.')[0] can never be undefined. The ?? fullyQualifiedName fallback is therefore unreachable dead code and is misleading about the guard it implies. Note that if you adopt Fqn.split (see related finding), an empty/invalid input could still throw or return [], in which case a real guard becomes meaningful โ€” otherwise this fallback can simply be removed.

โœ… Bug: serviceFqn arg ignored by getEntityLink; test mock hides mismatch

๐Ÿ“„ openmetadata-ui/src/main/resources/ui/src/components/common/MarkdownEditor/EntityMarkdownLink/EntityMarkdownLink.tsx:49-55 ๐Ÿ“„ openmetadata-ui/src/main/resources/ui/src/components/common/MarkdownEditor/EntityMarkdownLink/EntityMarkdownLink.tsx:84-85 ๐Ÿ“„ openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts:216-224 ๐Ÿ“„ openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts:457-462 ๐Ÿ“„ openmetadata-ui/src/main/resources/ui/src/components/common/MarkdownEditor/EntityMarkdownLink/EntityMarkdownLink.test.tsx:41-55 ๐Ÿ“„ openmetadata-ui/src/main/resources/ui/src/components/common/MarkdownEditor/EntityMarkdownLink/EntityMarkdownLink.test.tsx:191-205 parseEntityLink now extracts serviceFqn and EntityMarkdownLink passes it as the 8th argument to getEntityLink (EntityMarkdownLink.tsx:85). However, getEntityLink declares only 7 parameters โ€” serviceCategory is the last (EntityUtilClassBase.ts:216-224) and there is no serviceFqn parameter. The 8th argument is therefore silently ignored.

In the real INGESTION_PIPELINE case the route is built as getLogsViewerPath(serviceCategory ?? INGESTION_PIPELINE, fullyQualifiedName, fullyQualifiedName), and since ROUTES.LOGS = /:logEntityType/:fqn/logs, the produced path is /<serviceCategory>/<encodedFqn(pipelineFqn)>/logs โ€” it uses the pipeline FQN, never serviceFqn.

The unit test masks this: the mock (mockGetEntityLink, EntityMarkdownLink.test.tsx:41-58) returns /${serviceCategory}/${serviceFqn}/logs, so the test 'should render entity link with correct logs path' asserts /databaseServices/bigquery-beta/logs. Production would instead emit /databaseServices/bigquery-beta-1.7047fd1d-.../logs. The test gives false confidence because the mock's signature/behavior diverges from the real implementation.

Resolve by either (a) removing the now-dead serviceFqn extraction/interface field and the 8th call argument, and updating the test mock to mirror the real 7-param signature and pipeline-FQN-based route; or (b) if serviceFqn is genuinely needed for the route, add it as a real parameter to getEntityLink and use it in the getLogsViewerPath call.

Options

Display: compact โ†’ Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with ๐Ÿ‘ / ๐Ÿ‘Ž | Gitar

gitar-bot avatar Jun 30 '26 21:06 gitar-bot