Skip to content

fix(migrations): v201 AutoPilotWorkflow BPMN redeploy + task supersede fallback - #32156

Merged
yan-3005 merged 3 commits into
mainfrom
fix/autopilot-redeploy-and-task-defid-nofw
Aug 28, 2026
Merged

yan-3005 merged 3 commits into
mainfrom
fix/autopilot-redeploy-and-task-defid-nofw

Conversation

@yan-3005

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

Copy link
Copy Markdown
Contributor

Summary

Two focused changes, one PR:

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

Field definition uses non-existent field 'pipelineServiceClientExpr' of class
org.openmetadata.service.governance.workflows.elements.nodes.automatedTask
  .createAndRunIngestionPipeline.CreateIngestionPipelineDelegate

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, leaving stranded Flowable process instances and duplicate approval tasks on the same entity.

This PR adds a 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.

Test plan

  • Unit: MigrationProcessImplTest, MigrationWorkflowTest, CreateTaskTest (2 new fallback tests) all green.
  • End-to-end: verified locally by upgrading a 1.13 → 2.0 → 2.0.1 build; AutoPilotWorkflow instance progresses without the pipelineServiceClientExpr field-injection error; a prior task with a missing workflowDefinitionId is now correctly superseded on the next edit and its Flowable instance terminates.

Greptile Summary

This PR adds a v201 migration to redeploy AutoPilotWorkflow with the current delegate contract and adds a fallback for resolving missing task workflow-definition IDs.

  • Adds matching MySQL and PostgreSQL v201 migration entry points and native migration placeholders.
  • Redeploys the stored AutoPilotWorkflow definition during upgrade.
  • Resolves legacy tasks’ workflow definition through their workflow instance before superseding them.
  • Adds unit coverage for resolvable and missing workflow-instance fallback cases.

Confidence Score: 4/5

The PR is not yet safe to merge because a failed AutoPilot redeployment can still be permanently recorded as a successful v201 migration.

The migration continues to catch workflow initialization, repository lookup, and Flowable deployment failures without propagating them, so the migration framework can persist successful completion even though the stale AutoPilot BPMN remains and will not receive a targeted retry.

Files Needing Attention: openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v201/MigrationUtil.java, openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v201/Migration.java, openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v201/Migration.java

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v201/MigrationUtil.java Implements the targeted AutoPilot redeployment, but still converts repository and deployment failures into normal completion.
openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v201/Migration.java Registers the MySQL v201 Java migration while suppressing initialization and redeployment failures.
openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v201/Migration.java Mirrors the MySQL v201 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 null-only fallback that resolves a prior task’s workflow definition from its workflow instance.
openmetadata-service/src/test/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTaskTest.java Covers successful and unresolvable workflow-definition fallback behavior.

Reviews (2): Last reviewed commit: "chore(migrations): empty 2.0.1 SQL stubs..." | Re-trigger Greptile

- 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 #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.
@yan-3005
yan-3005 requested a review from a team as a code owner August 27, 2026 08:22
Copilot AI lite review requested due to automatic review settings August 27, 2026 08:22

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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
@yan-3005 yan-3005 added the To release Will cherry-pick this PR into the release branch label Aug 27, 2026
Copilot AI review requested due to automatic review settings August 27, 2026 08:27

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Aug 27, 2026

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

Adds a v201 Java migration to redeploy AutoPilotWorkflow and resolve missing task workflowDefinitionId values, and untracks generated UI config. No issues found.

✅ 1 resolved
✅ Quality: SQL migration comment overstates redeploy scope

📄 bootstrap/sql/migrations/native/2.0.1/mysql/schemaChanges.sql:3-6 📄 bootstrap/sql/migrations/native/2.0.1/postgres/schemaChanges.sql:3-6 📄 openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v201/MigrationUtil.java:27-40
The new schemaChanges.sql files (mysql and postgres) state the v201 Java migration "re-deploys every governance workflow definition," but MigrationUtil.redeployAutoPilotWorkflow() only re-deploys the single AutoPilotWorkflow definition (scoped intentionally, as the Java doc explains). This misleads operators about what the migration touches. Update the SQL comment to say it re-deploys only AutoPilotWorkflow to match the actual behavior.

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 58cdb48f835c7eecdc0a0cafbeb1c3b8bd59b538 in Playwright run 33054107576, 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) 52m 5s

⏱️ Max setup 4m 7s · max shard execution 17m 38s · max shard-job elapsed before upload 21m 2s · reporting 4s

🌐 214.37 requests/attempt · 2.80 app boots/UI scenario · 25.52% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 25.52% (convergence target: at most 15%).
  • Browser traffic was 214.37 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 137 0 0 0 0 0
✅ Shard chromium-02 147 0 0 0 0 0
✅ Shard chromium-03 143 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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-27T14:48:25Z)

Blocked the queue: playwright-summary

@yan-3005
yan-3005 added this pull request to the merge queue Aug 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 27, 2026
@yan-3005
yan-3005 added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit 6e94f0b Aug 28, 2026
116 of 119 checks passed
@yan-3005
yan-3005 deleted the fix/autopilot-redeploy-and-task-defid-nofw branch August 28, 2026 04:22
@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.13 branch.
Please cherry-pick the changes manually.
You can find more details here.

@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 2.0 branch.
Please cherry-pick the changes manually.
You can find more details here.

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

3 participants