Repository navigation
Fixes 38297: Move the 2.1.1 migration's workflow redeploy to server start - #38475
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Code Review ✅ Approved 🔴 High riskStartup now deploys every stored workflow whose BPMN differs, potentially changing future governance approvals and task execution across the deployment. Moves the 2.1.1 workflow redeploy to server start: stored workflows whose BPMN differs from the latest Flowable deployment are redeployed on each start, and workflow builders now emit a fixed order so BPMN is identical across JVMs. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
… owner to the admins (backport 2.1 #38307, #38475) (#38560) * Fixes 38297: Route suggestions on unowned assets through every owner to the admins (#38307) * feat(governance): let an approval task fall back to service and domain owners * feat(governance): route unowned suggestion tasks through every owner to the admins * test(governance): suggestion tasks reach service owners, then admins * fix(governance): look past owners who are the requester in the owner cascade * fix(governance): drop an unworkable remedy from the v211 migration error * test(migrations): list the 2.1.1 Migration classes as exceptions instead of widening the rule (cherry picked from commit b19c2d2) * Fixes 38297: Move the 2.1.1 migration's workflow redeploy to server start (#38475) * fix(governance): deploy changed workflows on server start, not in migrations * fix(governance): build the same workflow BPMN in every JVM * docs(decisions): note the one extra deploy after a save that reorders map keys * fix(governance): skip an unreadable workflow instead of deploying none on start * fix(governance): name the workflow skipped as unreadable * fix(governance): log the skipped workflow by its name (cherry picked from commit 3cdf00c) * docs: drop references to the migration architecture test, absent on 2.1
Describe your changes:
Fixes #38297
A release that changes a stored workflow, or how workflows are built, reached Flowable only through a migration step that deployed it, with the code of whatever release the upgrade ends on. The server now deploys, on every start, each workflow whose BPMN differs from its latest deployment, and the 2.1.1
SuggestionTaskWorkflowstep (#38307) only edits its row, soMigrationArchitectureTestlists no exception again.Type of change:
High-level design:
WorkflowHandler.deployChanged, called fromWorkflowDefinitionResource.initializeafter seed data): for each stored, non-deleted workflow this server can read, build the BPMN with the running code and compare it byte for byte with the latest Flowable deployment of the main and trigger workflow. A workflow that differs, or has none, is deployed; one that matches is not touched. A workflow that cannot be built or deployed is logged at error and keeps its deployment, and the server still starts.WorkflowHandlernotes the drain can take hours on a large Flowable history); the next deploy through the API drains them.NoOpTriggeriterated aSet.ofandCollectMetadataTaskaMap.ofinto the BPMN, whose order changes per JVM, so every restart would have redeployed the 15 seeded task workflows. Both now use a fixed order.WorkflowDefinitionRepository.listReadable(), the skip-and-log logicEntityStatusWorkflowsalready had, moved to the repository and shared. A row this server cannot decode (a node type from another version) is logged by name and skipped, and the others still deploy.SuggestionTaskOwnerFallbackMigrationonly changes the row; it and the 2.1.1Migrationclasses leave theMigrationArchitectureTestexceptions, and the guard checks them.ADR:2026-11-23-a-changed-workflow-is-deployed-when-the-server-starts; amendsADR:2026-11-11-a-data-migration-carries-its-own-logic(rule 4 names workflow deploys) andADR:2026-11-20-suggestion-tasks-fall-back-through-every-owner-to-the-admins.2.1yet; both go to2.1together before 2.1.1.Tests:
Use cases covered
MigrationArchitectureTestallows.Unit tests
WorkflowBpmnStableAcrossJvmsTest(new): builds every seeded workflow, and a collect-metadata task, in two child JVMs and compares the BPMN. Fails with the oldSet.oforder.WorkflowDefinitionRepositoryReadableTest(new): an unreadable row between two readable ones is skipped. Fails when the skip is removed.MigrationArchitectureTest: no exceptions, no empty-rule allowance. Fails with 5 violations against the old deploying 2.1.1 step.Backend integration tests
WorkflowStartupDeployIT(new, 4 cases). With the comparison forced to always deploy, the "left alone" and "deployed once" cases fail.Local Java test run: PASSED (focused, plus a trimmed set of affected ITs)
d3b1323dab5(baseorigin/main). After it,070eeea3281,901bdfa34eaand14a8a6d9daeshare the readable-rows logic; for those, the unit row above (1110 tests) andWorkflowStartupDeployIT,EntityStatusWorkflowOwnershipIT,LifecycleWorkflowConfigurationITon mysql-elasticsearch (10 passed) ran again.WorkflowBpmnStableAcrossJvmsTest,NoOpTriggerTest,CollectMetadataTaskTest(3 runs)WorkflowStartupDeployIT,WorkflowRedeploySignalIT,WorkflowSignalDeliveryIT,WorkflowTaskAssigneesIT,NegatedListRuleMigrationIT,SeedDataPresenceIT,IncidentWorkflowUpgradeIT,WorkflowResourceIT,TierCheckConditionWorkflowIT,OpenMetadataOperationsIT,ContinuousMigrationIT,TaskResourceIT,IncidentTaskIntegrationITWorkflowDefinitionResourceIT,AppsResourceIT,TagRecognizerFeedbackITWorkflowStartupDeployIT,NegatedListRuleMigrationIT,SeedDataPresenceIT,ContinuousMigrationIT,OpenMetadataOperationsITSkipped:
TaskResourceIT's inheritedBaseEntityITchecks it turns off for tasks,BaseEntityIT$ListEntityHistoryByTimestampPaginationTeston this engine, andAppsResourceIT's@Disabledcases. Every IT server boot loggedDeployed 0 workflow(s). The planner's full list (about 100 ITs) was not run; the merge queue runs it.Ingestion integration tests
Playwright (UI) tests
Manual testing performed
TaskReviewgainedcascadeOwners: true, and Flowable stayed on version 11, so the migration deployed nothing.SuggestionTaskWorkflowdeployed as version 12, with the other workflows whose BPMN this code builds differently.UI screen recording:
Not applicable: backend-only change.
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 commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: not applicable, no schema change.
For a UI feature or feature task: not applicable, backend-only.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.mdand fixed every 🔴 finding, or answered it on the line below.e3e4fd82934and070eeea3281(then a decision-record wording commit and a log message): no 🔴. The first pass found the per-JVM BPMN order, fixed ine3e4fd82934. Answered, not changed:initializecall has no test: only a mocked call-order test could pin it. The IT boots (Deployed 0) and the always-deploy run (it deployed all 20 seeded workflows at boot) show it runs; the live upgrade above checks it end to end.Decision check: adds
docs/decisions/2026-11-23-a-changed-workflow-is-deployed-when-the-server-starts.mdand amends two records.I have added a test that covers the exact scenario we are fixing.


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues remain.Summary
Moves changed-workflow deployment from the 2.1.1 migration to server startup.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Server starts] --> B[Initialize seed data] B --> C[Read stored workflows] C --> D{Row readable?} D -->|No| E[Log and skip] D -->|Yes| F[Build BPMN] F --> G{Matches latest deployment?} G -->|Yes| H[Leave deployment alone] G -->|No| I[Deploy without draining old versions] F -->|Build fails| J[Log and continue] I -->|Deploy fails| JReviews (6) · Last reviewed commit: "fix(governance): log the skipped workflo..." · Reviewed by Greptile