Repository navigation
Centralize enableStreamableLogs resolution at deploy; fix ingestion-runner replacement - #28741
Conversation
…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.
❌ 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 |
There was a problem hiding this comment.
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 ofenableStreamableLogs. - Fix
ServiceEntityRepository.updateIngestionRunnerto remove the previousUSESrelationship 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. |
| 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) {} |
| 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); |
| @@ -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) { |
There was a problem hiding this comment.
💡 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 👍 / 👎
| // 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) {} |
🟡 Playwright Results — all passed (18 flaky)✅ 4265 passed · ❌ 0 failed · 🟡 18 flaky · ⏭️ 88 skipped
🟡 18 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
… 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.
| 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()); |
|
Code Review 👍 Approved with suggestions 2 resolved / 3 findingsCentralizes 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
Note: Replace the magic 200 with the Response.Status.OK constant (requires importing jakarta.ws.rs.core.Response).✅ 2 resolved✅ Bug: App-run deploy path never persists derived streamableLogs flag
✅ Edge Case: Persisting mutated pipeline writes injected appConfig to DB
🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
…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.
…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



What
Centralize how
enableStreamableLogsis resolved for ingestion pipelines, and fix ingestion-runner relationship handling on services./deploy, AutoPilot governance (CreateIngestionPipelineImpl), app runs (RunAppImpl/AppResource), and the update hook — throughIngestionPipelineRepository.deployIngestionPipeline, which calls a new overridableapplyStreamableLogsConfig(pipeline). The default is a no-op (keeps the pipeline's own value); deployments override it to derive the flag.isS3LogStorageEnabled()-basedsetEnableStreamableLogs(true)inIngestionPipelineResourceand 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.ServiceEntityRepository.updateIngestionRunneradded a newUSES → ingestionRunnerrelationship without removing the previous one, leaving a service with multiple runners and makingservice.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