Repository navigation
[2.0] fix(migrations): v201 AutoPilotWorkflow BPMN redeploy + task supersede fallback - #32162
Conversation
…persede fallback 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.
❌ 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 |
Code Review ✅ ApprovedBackports AutoPilotWorkflow BPMN re-deployment via a v201 Java migration to fix Flowable field injection failures, and adds a defensive task supersede fallback to handle missing workflow definition IDs. No issues found. 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 ✅ 581 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) 49m 1s ⏱️ Max setup 2m 58s · max shard execution 13m 45s · max shard-job elapsed before upload 16m 42s · reporting 5s 🌐 206.90 requests/attempt · 2.80 app boots/UI scenario · 21.58% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Backport of #32156 to the 2.0 release branch.
1. AutoPilotWorkflow BPMN redeploy (v201)
#28741 removed
pipelineServiceClientExprfromCreateIngestionPipelineDelegate, but the BPMN deployed by earlier releases still declares that field. On upgrade to a build that carries #28741, every AutoPilotWorkflow run fails at Flowable field injection.A new v201 (2.0.1) Java migration re-deploys AutoPilotWorkflow so its Flowable process definition is regenerated from the current delegate class, restoring runtime execution.
2. Task supersede fallback (defensive only)
CreateTask.isSupersedablePriorApprovalTaskcomparescurrentWorkflowDefinitionId.equals(prior.getWorkflowDefinitionId()). When the prior task carries aworkflowInstanceIdbut noworkflowDefinitionId, the equality check runs againstnulland supersede silently no-ops.Defensive fallback only: when the prior task's
workflowDefinitionIdis missing, resolve it from itsworkflowInstancebefore the equality check. One lazy indexed read per null case; no bulk backfill, no writes to task rows.Greptile Summary
The PR adds a v201 migration to regenerate the persisted AutoPilotWorkflow BPMN and adds a workflow-instance lookup fallback for legacy approval tasks missing their workflow definition ID.
Confidence Score: 4/5
The PR should not merge until a failed AutoPilot BPMN redeployment causes the v201 migration to fail and remain retryable.
The migration's nested exception handlers allow version 2.0.1 to be recorded as complete even when the persisted incompatible BPMN was not replaced, leaving AutoPilot execution broken across later restarts.
Files Needing Attention: openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v201/MigrationUtil.java and the MySQL/PostgreSQL v201 Migration.java entry points
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD Upgrade[Upgrade to 2.0.1] --> V201[v201 data migration] V201 --> Init[Initialize WorkflowHandler] Init --> Load[Load AutoPilotWorkflow] Load --> Deploy[Generate and deploy current BPMN] Deploy --> Fixed[AutoPilot runs use current delegate fields] Init -. suppressed failure .-> Recorded[Migration returns normally and is recorded complete] Load -. suppressed failure .-> Recorded Deploy -. suppressed failure .-> Recorded Recorded --> Stale[Stale BPMN remains] Stale --> RuntimeFailure[AutoPilot field-injection failure persists] LegacyTask[Legacy approval task missing definition ID] --> InstanceLookup[Load workflow instance] InstanceLookup --> Compare[Compare resolved definition ID] Compare --> Supersede[Supersede prior approval task]Reviews (1): Last reviewed commit: "[2.0] fix(migrations): v201 AutoPilotWor..." | Re-trigger Greptile
Context used: