Skip to content

[2.0] fix(migrations): v201 AutoPilotWorkflow BPMN redeploy + task supersede fallback - #32162

Merged
yan-3005 merged 1 commit into
2.0from
fix/autopilot-redeploy-and-task-defid-2.0
Aug 28, 2026
Merged

yan-3005 merged 1 commit into
2.0from
fix/autopilot-redeploy-and-task-defid-2.0

Conversation

@yan-3005

@yan-3005 yan-3005 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #32156 to the 2.0 release branch.

1. AutoPilotWorkflow BPMN redeploy (v201)

#28741 removed pipelineServiceClientExpr from CreateIngestionPipelineDelegate, 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.isSupersedablePriorApprovalTask compares currentWorkflowDefinitionId.equals(prior.getWorkflowDefinitionId()). When the prior task carries a workflowInstanceId but no workflowDefinitionId, the equality check runs against null and supersede silently no-ops.

Defensive fallback only: when the prior task's workflowDefinitionId is missing, resolve it from its workflowInstance before 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.

  • Adds MySQL and PostgreSQL Java migration entry points for version 2.0.1.
  • Redeploys AutoPilotWorkflow from its current workflow definition.
  • Resolves legacy task workflow definition IDs through their workflow instances.
  • Adds unit coverage for resolvable and missing workflow-instance fallback cases.

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

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v201/MigrationUtil.java Adds the targeted AutoPilot redeployment but suppresses lookup and deployment failures, allowing the migration to complete without its required repair.
openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v201/Migration.java Registers the MySQL v201 data migration but catches all initialization and redeployment failures.
openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v201/Migration.java Mirrors the MySQL migration and its failure-suppression behavior for PostgreSQL.
openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTask.java Adds a narrowly scoped fallback that resolves missing legacy task definition IDs from workflow instances while preserving the existing supersede constraints.
openmetadata-service/src/test/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTaskTest.java Covers successful legacy definition resolution and the defensive no-match behavior when the referenced instance is absent.
bootstrap/sql/migrations/native/2.0.1/mysql/schemaChanges.sql Adds the empty SQL marker required for discovery of the Java-only MySQL migration.
bootstrap/sql/migrations/native/2.0.1/postgres/schemaChanges.sql Adds the empty SQL marker required for discovery of the Java-only PostgreSQL migration.

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]
Loading

Reviews (1): Last reviewed commit: "[2.0] fix(migrations): v201 AutoPilotWor..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Context used:

  • Context used - CLAUDE.md (source)

…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.
@yan-3005
yan-3005 requested a review from a team as a code owner August 27, 2026 09:23
@yan-3005 yan-3005 added the To release Will cherry-pick this PR into the release branch label Aug 27, 2026
@github-actions

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. 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 github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Aug 27, 2026
@gitar-bot

gitar-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backports 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.

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 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 00c2e59b4c42c9b6791ee4413713dc2f79d8e1b2 in Playwright run 33058340223, attempt 1.

✅ 581 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Common shard skew was 21.58% (convergence target: at most 15%).
  • Browser traffic was 206.9 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.8 per UI scenario (1683 boots / 602 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 114 0 0 0 0 0
✅ Shard chromium-02 94 0 0 0 0 0
✅ Shard chromium-03 104 0 0 0 0 0
✅ Shard chromium-04 115 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

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

@yan-3005
yan-3005 merged commit f972d99 into 2.0 Aug 28, 2026
187 of 196 checks passed
@yan-3005
yan-3005 deleted the fix/autopilot-redeploy-and-task-defid-2.0 branch August 28, 2026 04:31
@yan-3005 yan-3005 self-assigned this Nov 19, 2026

This branch was previously deployed

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

Labels

backend safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants