Skip to content

Centralize enableStreamableLogs resolution at deploy; fix ingestion-runner replacement - #28741

Merged
IceS2 merged 8 commits into
mainfrom
fix/streamable-logs-runner-driven
Jun 8, 2026
Merged

IceS2 merged 8 commits into
mainfrom
fix/streamable-logs-runner-driven

Conversation

@IceS2

@IceS2 IceS2 commented Jun 5, 2026 •

Copy link
Copy Markdown
Collaborator

What

Centralize how enableStreamableLogs is resolved for ingestion pipelines, and fix ingestion-runner relationship handling on services.

  • Single deploy-time hook. Route every deploy path — REST /deploy, AutoPilot governance (CreateIngestionPipelineImpl), app runs (RunAppImpl/AppResource), and the update hook — through IngestionPipelineRepository.deployIngestionPipeline, which calls a new overridable applyStreamableLogsConfig(pipeline). The default is a no-op (keeps the pipeline's own value); deployments override it to derive the flag.
  • Remove the global force. Drop the isS3LogStorageEnabled()-based setEnableStreamableLogs(true) in IngestionPipelineResource and the update-hook deploy path. That check was global (storage-level) and applied on only one deploy path, so the flag was set inconsistently across pipelines.
  • Fix runner replacement. ServiceEntityRepository.updateIngestionRunner added a new USES → ingestionRunner relationship without removing the previous one, leaving a service with multiple runners and making service.getIngestionRunner() resolution order-dependent. Delete the old relationship before adding the new one.

Why

The streamable-logs flag was set by a global storage check on a single entry point rather than derived consistently, so the value sent to ingestion (write) and the value used to fetch logs (read) could disagree — pipelines that weren't redeployed through that path showed no logs, while pipelines forced on duplicated their log writes. Centralizing resolution behind one hook lets each deployment derive the flag consistently. The runner-relationship fix keeps runner resolution deterministic.

Fixes: https://github.com/open-metadata/openmetadata-collate/issues/4427

IceS2 added 3 commits June 4, 2026 12:41
…ory hook

Route every deploy path (REST, AutoPilot governance, app runs, update hook)
through IngestionPipelineRepository.deployIngestionPipeline, which applies an
overridable applyStreamableLogsConfig hook. Removes the global S3-storage force
in the Resource and update-hook paths so the flag is no longer forced true on
SaaS pipelines in clusters that have S3 log storage configured.
…hook

So enableStreamableLogs is derived from the app's runner for hybrid-runner apps,
consistent with service and test-suite pipelines.
…ting

updateIngestionRunner added a new USES->ingestionRunner relationship without
removing the previous one, leaving a service with multiple (hybrid) runners and
making service.getIngestionRunner() resolution order-dependent. Delete the old
runner relationship before adding the new one.
Copilot AI review requested due to automatic review settings June 5, 2026 08:25
@github-actions

github-actions Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

  • No GitHub issue is linked. Add a closing reference such as Fixes #12345 to the PR description (accepted keywords: Fixes, Closes, Resolves).

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 github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Jun 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors ingestion-pipeline deployments to funnel multiple deploy entry points through IngestionPipelineRepository.deployIngestionPipeline(...) (introducing a deploy-time hook for enableStreamableLogs), and fixes service → ingestion-runner relationship replacement to avoid multiple runners being attached to a service.

Changes:

  • Route deploy calls from REST, apps, and governance workflow nodes through IngestionPipelineRepository.deployIngestionPipeline(...).
  • Add a single deploy-time hook (applyStreamableLogsConfig) and remove the prior global S3-based forcing of enableStreamableLogs.
  • Fix ServiceEntityRepository.updateIngestionRunner to remove the previous USES relationship before adding the new runner relationship.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java Deploy endpoint now uses repository deploy wrapper (removes per-path streamable-logs forcing).
openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java App deploy flow now deploys ingestion pipeline via repository wrapper.
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ServiceEntityRepository.java Ensures ingestion-runner relationship is replaced (old runner link removed) rather than appended.
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/IngestionPipelineRepository.java Removes update-hook forcing, adds deploy wrapper + deploy-time hook for streamable logs config.
openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/runApp/RunAppImpl.java App-run workflow deploy step now uses repository deploy wrapper.
openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/createAndRunIngestionPipeline/CreateIngestionPipelineImpl.java Governance pipeline creation deploy now goes through repository deploy wrapper (drops direct client injection).
openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/createAndRunIngestionPipeline/CreateIngestionPipelineDelegate.java Removes pipeline-service-client expression wiring for the create/deploy step.
openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/createAndRunIngestionPipeline/CreateAndRunIngestionPipelineTask.java Removes the PipelineServiceClient field extension from the create-ingestion-pipeline service task.

Comment on lines 1314 to +1322
public PipelineServiceClientResponse deployIngestionPipeline(
IngestionPipeline ingestionPipeline, ServiceEntityInterface service) {
applyStreamableLogsConfig(ingestionPipeline);
return pipelineServiceClient.deployPipeline(ingestionPipeline, service);
}

// Single deploy-time hook for enableStreamableLogs, shared by every deploy path.
// Default keeps the pipeline's own value; overridden to derive it from the ingestion runner.
protected void applyStreamableLogsConfig(IngestionPipeline ingestionPipeline) {}
Comment on lines 186 to +192
LOG.info(
"[GovernanceWorkflows] Deploying '{}' for '{}'",
ingestionPipeline.getDisplayName(),
service.getName());
wasSuccessful = deployPipeline(pipelineServiceClient, ingestionPipeline, service);
IngestionPipelineRepository repository =
(IngestionPipelineRepository) Entity.getEntityRepository(Entity.INGESTION_PIPELINE);
wasSuccessful = deployPipeline(repository, ingestionPipeline, service);
Comment on lines 239 to 258
@@ -254,7 +253,7 @@ private IngestionPipeline deployIngestionPipeline(
ingestionPipelineConfig.put("appConfig", app.getAppConfiguration());
ingestionPipeline.getSourceConfig().setConfig(ingestionPipelineConfig);

pipelineServiceClient.deployPipeline(
repository.deployIngestionPipeline(
ingestionPipeline,
Entity.getEntity(ingestionPipeline.getService(), "ingestionRunner", Include.NON_DELETED));
RunAppImpl.deployIngestionPipeline deployed via the repository hook (which derives
enableStreamableLogs) but never persisted the pipeline, unlike the other deploy
paths, so the stored value could diverge from what was sent to ingestion. Persist
on a successful deploy.
ingestionPipeline,
Entity.getEntity(
ingestionPipeline.getService(), "ingestionRunner", Include.NON_DELETED));
if (status.getCode() == 200) {

@gitar-bot gitar-bot Bot Jun 5, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Magic number 200 for HTTP status code

if (status.getCode() == 200) hardcodes the HTTP success code as a magic number, which the project standards prohibit (use enums/constants). Use the JAX-RS Response.Status.OK.getStatusCode() constant instead so the intent is explicit and consistent with other deploy paths.

Note: getCode() returns an Integer. If the response ever carries a null code, the == 200 comparison will auto-unbox and throw a NullPointerException. Comparing against the constant via .equals or guarding for null avoids this.

Replace the magic 200 with the Response.Status.OK constant (requires importing jakarta.ws.rs.core.Response).:

if (Response.Status.OK.getStatusCode() == status.getCode()) {
  repository.createOrUpdate(null, ingestionPipeline, ingestionPipeline.getUpdatedBy());
}

Was this helpful? React with 👍 / 👎

@IceS2 IceS2 added the skip-pr-checks Bypass PR metadata validation check label Jun 5, 2026
Copilot AI review requested due to automatic review settings June 5, 2026 09:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment on lines +1320 to +1323
// Single deploy-time hook for enableStreamableLogs, shared by every deploy path.
// Default keeps the pipeline's own value; overrides resolve the pipeline's owning ingestion
// runner (service / test-suite / application) and derive the flag from it.
protected void applyStreamableLogsConfig(IngestionPipeline ingestionPipeline) {}
@github-actions

github-actions Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (18 flaky)

✅ 4265 passed · ❌ 0 failed · 🟡 18 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 300 0 1 4
🟡 Shard 2 802 0 4 9
🟡 Shard 3 800 0 4 8
🟡 Shard 4 843 0 4 12
🟡 Shard 5 719 0 2 47
🟡 Shard 6 801 0 3 8
🟡 18 flaky test(s) (passed on retry)
  • Pages/SearchSettings.spec.ts › Preview config reflects reverted n-gram weight after save (shard 1, 1 retry)
  • Features/BulkImport.spec.ts › Database Schema (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › EditAll User: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with only VIEW cannot PATCH results (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Table.spec.ts › Table pagination with sorting should works (shard 3, 1 retry)
  • Features/Tasks/TaskNavigation.spec.ts › navigating to /table/TASK-XXXXX should show 404 (invalid URL pattern) (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should not show online status for inactive users (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Enum (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Timestamp (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Domain Rbac (shard 4, 1 retry)
  • Pages/EntityDataSteward.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Tier Add, Update and Remove (shard 6, 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

pmbrull
pmbrull previously approved these changes Jun 8, 2026
… derived flag

DataContractRepository.prepareAndDeployIngestionPipeline deployed via the raw
pipeline client, bypassing applyStreamableLogsConfig — route it through
IngestionPipelineRepository.deployIngestionPipeline so the hook runs on every
deploy path.

RunAppImpl injected appConfig into sourceConfig for the deploy call; persisting
that mutated object leaked appConfig into the stored pipeline. Re-read the clean
entity and persist only the runner-derived enableStreamableLogs flag.
Copilot AI review requested due to automatic review settings June 8, 2026 08:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment on lines 29 to 33
private Expression pipelineTypeExpr;
private Expression deployExpr;
private Expression inputNamespaceMapExpr;
private Expression ingestionPipelineMapperExpr;
private Expression pipelineServiceClientExpr;

// must not leak into the stored pipeline, so re-read the clean entity first.
IngestionPipeline stored = repository.get(null, pipelineRef.getId(), EMPTY_FIELDS);
stored.setEnableStreamableLogs(ingestionPipeline.getEnableStreamableLogs());
repository.createOrUpdate(null, stored, stored.getUpdatedBy());
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@IceS2
IceS2 merged commit 764c113 into main Jun 8, 2026
55 of 57 checks passed
@IceS2
IceS2 deleted the fix/streamable-logs-runner-driven branch June 8, 2026 14:10
@gitar-bot

gitar-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 2 resolved / 3 findings

Centralizes streamableLogs resolution within the deployment hook and ensures deterministic ingestion runner updates by removing stale relationships. Replace the magic number 200 with an appropriate HTTP constant to improve readability.

💡 Quality: Magic number 200 for HTTP status code

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/runApp/RunAppImpl.java:262

if (status.getCode() == 200) hardcodes the HTTP success code as a magic number, which the project standards prohibit (use enums/constants). Use the JAX-RS Response.Status.OK.getStatusCode() constant instead so the intent is explicit and consistent with other deploy paths.

Note: getCode() returns an Integer. If the response ever carries a null code, the == 200 comparison will auto-unbox and throw a NullPointerException. Comparing against the constant via .equals or guarding for null avoids this.

Replace the magic 200 with the Response.Status.OK constant (requires importing jakarta.ws.rs.core.Response).
if (Response.Status.OK.getStatusCode() == status.getCode()) {
  repository.createOrUpdate(null, ingestionPipeline, ingestionPipeline.getUpdatedBy());
}
✅ 2 resolved
✅ Bug: App-run deploy path never persists derived streamableLogs flag

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/runApp/RunAppImpl.java:239-253
In RunAppImpl.deployIngestionPipeline(App) the pipeline is deployed via repository.deployIngestionPipeline(...) (line 256), which now mutates the pipeline through the new applyStreamableLogsConfig(pipeline) hook. However, unlike the other migrated deploy paths (CreateIngestionPipelineImpl and AppResource, which both call createOrUpdate(...) after a successful deploy), this method returns the in-memory pipeline without ever persisting it.

Consequence: the value the hook derives is sent to ingestion (the write side) but the stored IngestionPipeline entity keeps its old enableStreamableLogs value. When logs are later fetched (the read side), resolution uses the persisted entity, so write and read can disagree — the exact inconsistency this PR aims to eliminate. For app-run pipelines whose flag the deployment override flips, log writes/reads will be out of sync.

Suggested fix: persist the pipeline after a successful deploy in this path, mirroring the other call sites (e.g. repository.createOrUpdate(null, ingestionPipeline, ingestionPipeline.getUpdatedBy())).

✅ Edge Case: Persisting mutated pipeline writes injected appConfig to DB

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/runApp/RunAppImpl.java:252-264
Before calling repository.createOrUpdate, the pipeline's sourceConfig.config is mutated to inject appConfig (app.getAppConfiguration()) for the deploy call (lines 252-255). The new createOrUpdate on success now persists this mutated object, so the injected appConfig is written into the stored ingestion pipeline's sourceConfig — a behavior change versus the prior code which never persisted. The intent of this commit is to persist the derived enableStreamableLogs flag; persisting the injected appConfig is an incidental side effect. While openMetadataServerConnection is stripped by getFieldsStrippedFromStorageJson, appConfig is not, so app-specific configuration now leaks into the pipeline entity. Each subsequent run re-injects it, so it is largely self-correcting, but consider persisting only the deploy-derived fields (or re-reading the pipeline before persisting) to avoid storing transient deploy-time mutations.

🤖 Prompt for agents
Code Review: Centralizes streamableLogs resolution within the deployment hook and ensures deterministic ingestion runner updates by removing stale relationships. Replace the magic number 200 with an appropriate HTTP constant to improve readability.

1. 💡 Quality: Magic number 200 for HTTP status code
   Files: openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/runApp/RunAppImpl.java:262

   `if (status.getCode() == 200)` hardcodes the HTTP success code as a magic number, which the project standards prohibit (use enums/constants). Use the JAX-RS `Response.Status.OK.getStatusCode()` constant instead so the intent is explicit and consistent with other deploy paths.
   
   Note: `getCode()` returns an `Integer`. If the response ever carries a null code, the `== 200` comparison will auto-unbox and throw a NullPointerException. Comparing against the constant via `.equals` or guarding for null avoids this.

   Fix (Replace the magic 200 with the Response.Status.OK constant (requires importing jakarta.ws.rs.core.Response).):
   if (Response.Status.OK.getStatusCode() == status.getCode()) {
     repository.createOrUpdate(null, ingestionPipeline, ingestionPipeline.getUpdatedBy());
   }

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

yan-3005 added a commit that referenced this pull request Aug 28, 2026
…persede fallback (#32162)

Backport of #32156.

- v201 (2.0.1) Java migration re-deploys AutoPilotWorkflow so its Flowable
  process definition is regenerated from the current delegate class. Fixes
  the "non-existent field 'pipelineServiceClientExpr'" injection failure
  after upgrading past #28741.
- Defensive fallback in CreateTask.isSupersedablePriorApprovalTask: when the
  prior task carries a workflowInstanceId but no workflowDefinitionId,
  resolve the definition id from the instance before the equality check.
  One lazy read per null case; no bulk backfill.
timothybrush pushed a commit to timothybrush/OpenMetadata that referenced this pull request Aug 28, 2026
…e fallback (open-metadata#32156)

* fix(migrations): v201 workflow-BPMN redeploy + task supersede fallback

- v201 (2.0.1) native migration re-deploys every workflow definition so the
  Flowable BPMN is regenerated against current delegate classes. Fixes the
  AutoPilotWorkflow "non-existent field pipelineServiceClientExpr" injection
  failure observed after upgrade (delegate field removed in open-metadata#28741).
- CreateTask.isSupersedablePriorApprovalTask now resolves the prior task's
  workflowDefinitionId from its workflow instance when the task itself
  carries none. Migrated tasks from the pre-2.0 thread model were wired to
  a workflowInstanceId but never stamped with a workflowDefinitionId, which
  made the supersede match fail and left duplicate approval tasks on re-edit.

* chore(migrations): empty 2.0.1 SQL stubs — Java-only migration, match existing pattern

This branch was previously deployed

1 inactive deployment
test — a9b5117a Deployed Jun 8, 2026 by IceS2 via playwright-ci-postgresql (6, 6) #50254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants