Skip to content

Accept fullyQualifiedName on the ingestion pipeline log endpoints#30187

Open
Khairajani wants to merge 5 commits into
mainfrom
logs-accept-fqn
Open

Accept fullyQualifiedName on the ingestion pipeline log endpoints#30187
Khairajani wants to merge 5 commits into
mainfrom
logs-accept-fqn

Conversation

@Khairajani

@Khairajani Khairajani commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Closes #30197

What

GET /services/ingestionPipelines/logs/{id}/last and /logs/{id}/last/download accepted only a pipeline Id (UUID). They now accept either the Id or the pipeline's fullyQualifiedName.

The Id form is unchanged and remains fully supported — the fqn is purely additive, so this is backward compatible.

Why

Logs are keyed by the pipeline's fully-qualified name. A caller that already holds the fqn had to first resolve it to an Id just to ask for logs, which is an extra lookup for an identifier the log store never uses. Accepting the fqn removes that hop and keeps a pipeline's log URL stable across its lifetime.

How

A pipeline Id is always a UUID and an fqn never is, so dispatch is unambiguous: the path segment is parsed as a UUID first and treated as an fqn only when that parse fails.

private IngestionPipeline getIngestionPipelineByIdOrName(
    UriInfo uriInfo, SecurityContext securityContext, String idOrName, String fields) {
  try {
    UUID pipelineId = UUID.fromString(idOrName);
    return getInternal(uriInfo, securityContext, pipelineId, fields, Include.NON_DELETED);
  } catch (IllegalArgumentException notAUuid) {
    // Not a UUID -> treat the segment as the pipeline's fullyQualifiedName.
    return getByNameInternal(uriInfo, securityContext, idOrName, fields, Include.NON_DELETED);
  }
}

Both endpoints keep Include.NON_DELETED and the same fields set, so authorization and visibility are unchanged on both branches.

UI

The log viewer and the agents view now fetch and download by fqn.

A response keyed by fqn has no pipeline type available to select a *_task field, so it carries the log text under a generic logs key. The two extractors (getLogsFromResponse, getLogTaskFieldForType) prefer that key and fall back to the type-specific field — by-id responses are handled exactly as before.

Tests

  • New cases covering the generic logs key in LogsUtils.test.ts and agentsDataMapper.test.ts, including precedence over the *_task field.
  • useEntityLogs.test.ts updated for the by-fqn fetch/download.
  • All 25 suites touching the changed modules pass.

Greptile Summary

This PR lets ingestion pipeline log endpoints accept either a UUID or a fully qualified name. The main changes are:

  • Resolve both identifier forms through the existing pipeline lookup paths.
  • Fetch and download UI logs using fully qualified names.
  • Support generic and task-specific log response fields.
  • Add backend and frontend coverage for the new behavior.

Confidence Score: 5/5

This looks safe to merge.

  • The request gate now checks the FQN used by the log request.
  • UUID and FQN lookups preserve the existing authorization and visibility behavior.
  • No blocking issues were found in the changed code.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java Adds shared UUID-or-name resolution to both ingestion log endpoints while preserving authorization and non-deleted filtering.
openmetadata-ui/src/main/resources/ui/src/hooks/useEntityLogs.ts Uses the resolved pipeline FQN consistently for log requests, pagination resets, request gating, and downloads.
openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentLogs.ts Moves agent log fetching and pagination state from pipeline IDs to FQNs.
openmetadata-ui/src/main/resources/ui/src/rest/ingestionPipelineAPI.ts Accepts either identifier form and encodes it before building fetch and download URLs.
openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.ts Adds generic log-field handling while retaining task-specific fallback behavior.
openmetadata-ui/src/main/resources/ui/src/utils/IngestionLogs/LogsUtils.ts Adds the same generic log-field handling to shared ingestion log extraction.

Comments Outside Diff (1)

  1. openmetadata-ui/src/main/resources/ui/src/hooks/useEntityLogs.ts, line 121 (link)

    P2 Fetch Gate Uses Different Identifier

    The request now uses ingestionFqn, but this gate still checks ingestionId. If pipeline details contain an ID without a fully qualified name, the hook is enabled and requests /logs//last, producing a failed request instead of waiting for the identifier it actually needs.

    Context Used: CLAUDE.md (source)

Reviews (5): Last reviewed commit: "Align log endpoint docs with the id-or-f..." | Re-trigger Greptile

Context used:

  • Context used - CLAUDE.md (source)
  • Context used - AGENTS.md (source)

The two log endpoints, GET /logs/{id}/last and /logs/{id}/last/download,
accepted only a pipeline Id (UUID). They now accept either the Id or the
pipeline's fullyQualifiedName. The Id form is unchanged and remains fully
supported; the fqn is purely additive.

Logs are keyed by the pipeline's fully-qualified name, so a caller holding
the fqn had to resolve it to an Id before it could ask for logs. Accepting
the fqn removes that extra lookup and keeps a pipeline's log URL stable for
its lifetime. Dispatch is unambiguous: a pipeline Id is always a UUID, an
fqn never is, so the path segment is parsed as a UUID first and treated as
an fqn only when that fails.

The UI now fetches and downloads logs by fqn. A response keyed by fqn has no
pipeline type to select a *_task field, so it carries the log text under a
generic `logs` key; the two extractors prefer that key and fall back to the
type-specific field, leaving by-id responses handled exactly as before.
@Khairajani
Khairajani requested a review from a team as a code owner July 17, 2026 14:04
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

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!

@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
65.02% (75538/116171) 48.85% (45038/92188) 49.63% (13619/27441)

Guards that both log endpoints (getLastIngestionLogs, downloadLastIngestionLogs)
expose their id path segment as a String with schema type=string, which is what
lets them accept either a pipeline Id (UUID) or a fullyQualifiedName. A
UUID-typed parameter would reject an fqn at the framework boundary before the
resource could dispatch on it, so this locks in the backward-compatible widening.
The paginated log fetch fires by fullyQualifiedName, but the enable gate and
reset key still keyed on the pipeline Id. A pipeline whose details carry an Id
but no fqn would enable the hook and request `/logs//last` with an empty
segment. Gate and key on the fqn instead, so the hook waits for the identifier
it actually uses.
@Khairajani

Copy link
Copy Markdown
Contributor Author

Good catch on the P2 — fixed in b26653b. The paginated fetch runs by fqn, but the enabled gate and resetKey still keyed on the pipeline Id, so a pipeline carrying an Id without an fqn would have requested /logs//last. Both now gate/key on ingestionFqn, and added a test asserting the hook does not fetch until the fqn is known.

…ting

Both log endpoints advertised "by `Id`" in their @operation description and a
"Logs for instance {id}" 404, though the path segment now accepts a
fullyQualifiedName too. Update the descriptions to "`Id` or `fullyQualifiedName`"
and reword the 404 so the generated OpenAPI is accurate.

Apply eslint/prettier to useEntityLogs.test.ts.
@Khairajani

Copy link
Copy Markdown
Contributor Author

Addressed in af959be:

  • Doc finding: updated both getLastIngestionLogs and downloadLastIngestionLogs — the @Operation descriptions now read Id` or `fullyQualifiedName and the 404 @ApiResponse no longer implies an Id-only lookup, so the generated OpenAPI matches the widened @Parameter.
  • UI checkstyle: ran eslint + prettier on useEntityLogs.test.ts; the suite passes (9/9).

@gitar-bot

gitar-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Enables ingestion pipeline log endpoints to accept fully qualified names alongside UUIDs, resolving the need for redundant ID lookups. Backend test coverage and documentation have been updated to reflect the new ID-or-FQN contract.

✅ 2 resolved
Bug: No backend test for UUID-vs-fqn log endpoint dispatch

📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java:980-989
The new getIngestionPipelineByIdOrName dispatch (UUID parse first, fqn fallback) is a behavior change to two public endpoints but has no Java-side test; only the UI extractors are covered. Add a resource test asserting GET /logs/{id}/last resolves both a UUID and a fullyQualifiedName to the same pipeline, guarding backward compatibility and the fqn branch.

Quality: Download endpoint docs still say logs are fetched by Id

📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java:1071 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java:1077
The downloadLastIngestionLogs @Operation description ("Stream all logs... by Id") and the 404 @ApiResponse ("Logs for instance {id} is not found") were not updated to reflect that the path segment now accepts a fullyQualifiedName as well. Align these strings with the new @Parameter description ("Id (UUID) or fullyQualifiedName") so the generated OpenAPI docs are accurate.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 1 failure(s), 27 flaky

✅ 4542 passed · ❌ 1 failed · 🟡 27 flaky · ⏭️ 96 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 437 0 3 16
✅ Shard 2 11 0 0 0
🟡 Shard 3 820 0 12 8
🟡 Shard 4 822 0 1 18
🟡 Shard 5 838 0 3 5
🟡 Shard 6 787 0 1 46
🔴 Shard 7 827 1 7 3

Genuine Failures (failed on all attempts)

Features/AutoPilot.spec.ts › Create Service and check the AutoPilot status (shard 7)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: getByText('AutoPilot agents run completed successfully.')
Expected: visible
Timeout: 60000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 60000ms�[22m
�[2m  - waiting for getByText('AutoPilot agents run completed successfully.')�[22m

🟡 27 flaky test(s) (passed on retry)
  • Flow/TestConnectionModal.spec.ts › failure state shows remediation card with error content (shard 1, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › a fully denied user sees neither asset type when browsing (shard 1, 1 retry)
  • Features/BulkImportWithDotInName.spec.ts › Full import cycle with dot in service name (shard 3, 1 retry)
  • Features/BulkImportWithDotInName.spec.ts › Column with dot in name under service with dot (shard 3, 1 retry)
  • Features/ContextCenterArchive.spec.ts › archive page lazy-loads more rows on scroll within its own scroll container (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article listing search filters, clears, and shows empty state (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article list cards, recently viewed widget, and pagination work (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › description: switching articles does not bleed unsaved content into next article (shard 3, 1 retry)
  • Features/ContextCenterDocument.spec.ts › moving document to folder shows folder on card; re-opening menu shows current folder selected; clicking it again removes document from folder (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › adding a linked asset in edit mode shows entity badge on the row (shard 3, 1 retry)
  • Features/ContextCenterPermission.spec.ts › created-by-me filter on the archive page shows only the current user's archived documents (shard 3, 2 retries)
  • Features/DataQuality/TestCaseImportExportBasic.spec.ts › should show validation errors for invalid CSV (shard 3, 1 retry)
  • Features/Glossary/GlossaryAdvancedOperations.spec.ts › should change domain on glossary (shard 3, 1 retry)
  • Features/Glossary/GlossaryAdvancedOperations.spec.ts › should create term with custom style icon URL (shard 3, 1 retry)
  • Features/MetricBulkImportExportEdit.spec.ts › MetricListPage unchecking header checkbox clears the selection bar (shard 4, 2 retries)
  • Pages/CustomProperties.spec.ts › Hyperlink (shard 5, 1 retry)
  • Pages/CustomProperties.spec.ts › Hyperlink (shard 5, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Set (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 6, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Glossary Bulk Import Export (shard 7, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Import partial success - some terms pass, some fail (shard 7, 1 retry)
  • Pages/InputOutputPorts.spec.ts › Output ports section collapse/expand (shard 7, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for apiService in platform lineage (shard 7, 1 retry)
  • Pages/TestSuite.spec.ts › Logical TestSuite (shard 7, 1 retry)

📦 Download artifacts

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query Runner: fetch logs by {fqn} instead of pipeline {id}

1 participant