Skip to content

Fixes #38020: tolerate null workflow config when building BPMN - #38048

Merged
yan-3005 merged 5 commits into
mainfrom
detail/bug-fix/fixes-38020-propagate-v1-7-1-config-backfill-failu-be7ece
Nov 19, 2026
Merged

yan-3005 merged 5 commits into
mainfrom
detail/bug-fix/fixes-38020-propagate-v1-7-1-config-backfill-failu-be7ece

Conversation

@detail-app

@detail-app detail-app Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Describe your changes:

Fixes #38020

Pre-1.7.1 WorkflowDefinition rows that the v1.7.1 backfill skipped are stored with config = null. The node builders dereference config.getStoreStageStatus(), so any PUT/PATCH/redeploy of such a workflow threw a NullPointerException from BPMN build and returned a 500, leaving the workflow un-editable.

MainWorkflow is the single chokepoint for every BPMN build path (requireDeployable, WorkflowHandler.deploy, WorkflowHandler.redeploy). It now builds nodes with the stored config, or with new WorkflowConfiguration() (storeStageStatus=false, the same default the backfill writes) when the stored config is null. The legacy definition builds, and the next save repairs it.

Null config is only reachable from legacy rows: WorkflowDefinitionMapper always sets a config on create.

Why the migration is unchanged

An earlier revision of this PR made the v1.7.1 migration rethrow backfill failures so the version would be retried. That was dropped on purpose: migrations log and skip failures and must not block an upgrade or app start. A deterministic per-definition failure would fail every migrate run and hard-block the upgrade, which is worse than one un-editable workflow, and the MainWorkflow guard already removes that consequence.

Type of change:

  • Bug fix

Tests:

Unit tests

  • MainWorkflowTest.nullConfigBuildsWithoutNullPointerException: a definition with config = null builds its start and end nodes without an NPE.
  • mvn test -pl openmetadata-service -Dtest=MainWorkflowTest → Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

Backend integration tests

  • Not applicable (no API or migration change; BPMN build path covered by the unit test).

Ingestion integration tests

  • Not applicable.

Playwright (UI) tests

  • Not applicable (backend only).

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have added a test that covers the exact scenario we are fixing.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new blocking issues were found.

Summary

Adds a default configuration when an older workflow has no saved configuration, allowing its BPMN model to build.

  • Workflows with no saved config can still build into BPMN.

No new actionable issues found. Tests were not run during this review.

Reviews (5) · Last reviewed commit: "Merge branch 'main' into detail/bug-fix/..." · Reviewed by Greptile

@detail-app
detail-app Bot requested a review from a team as a code owner November 18, 2026 04:31
@detail-app
detail-app Bot requested a review from yan-3005 November 18, 2026 04:31
…grationUtil

updateWorkflowDefinitions() caught and logged each createOrUpdate()
failure then returned normally, so MigrationWorkflow recorded v1.7.1 as
complete and left that workflow's config = null permanently — the
NPE-on-edit/redeploy failure mode this PR fixes. Collect per-definition
failures and throw after the loop (best-effort for the remaining
definitions), so the next migrate/startup retries the backfill. Add a
focused MigrationUtilTest exercising the real backfill against a
WorkflowDefinitionRepository boundary mock.
detail-app Bot and others added 2 commits November 18, 2026 13:39
…in MainWorkflow

A failed migration step must not block upgrades or startup. A deterministic
per-definition failure would fail every migrate run, so rethrowing turns one
un-editable legacy workflow into a hard-blocked upgrade. Restore the original
log-and-skip behaviour in the v1.7.1 migration and MigrationUtil.

The MainWorkflow null-config guard alone removes the NPE on edit/redeploy for
legacy definitions the backfill skipped, so it is the whole fix.
@yan-3005 yan-3005 changed the title Fixes #38020: propagate v1.7.1 config backfill failure and tolerate null config Fixes #38020: tolerate null workflow config when building BPMN Nov 19, 2026
@yan-3005
yan-3005 merged commit 170bb9d into main Nov 19, 2026
54 checks passed
@yan-3005
yan-3005 deleted the detail/bug-fix/fixes-38020-propagate-v1-7-1-config-backfill-failu-be7ece branch November 19, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Detail Bug] Workflows: v1.7.1 migration can be marked complete even when workflow config backfill fails, leaving legacy workflows un-editable

3 participants