Repository navigation
[2.0] Discover workflow node factories from the classpath so migrate builds distribution nodes (backport 2.0 #38133) - #38141
Conversation
NodeFactoryRegistry registers the factories of every NodeFactoryProvider listed in META-INF/services when it is first used, so migrate builds the nodes a distribution implements and a migration that redeploys workflows covers them. Discovery skips a provider it cannot load or ask, and logs when it stops at its error cap.
❌ 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 ✅ Approved 🟡 Medium riskClasspath discovery changes which workflow factories migration can build; provider-loading failures could leave distribution-specific workflow nodes unavailable. Backports the classpath discovery of workflow node factories so 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 |
| NodeFactoryRegistry registry = NodeFactoryRegistry.discover(loader); | ||
|
|
||
| Optional<NodeInterface> result = |
There was a problem hiding this comment.
Discovery tests omit required
final. The new registry and result locals are never reassigned but lack final. The repository requires: “Use final on local variables and parameters that don't change.” Add it here and throughout the new test code, including the second discovery test and the classLoaderListing parameters.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Describe your changes:
Backport of #38133 to
2.0. Companion Collate backport: open-metadata/openmetadata-collate#8693migrateruns in its own process and never runs a distribution's server startup, where its workflow node factories were registered, so the 2.0.8 governance workflow redeploy could not build the Collate-only nodes (Redeployed 24 of 26on Collate clusters).NodeFactoryRegistrynow registers everyNodeFactoryProviderlisted inMETA-INF/serviceswhen it is first used, so every process builds them. A provider that cannot be loaded or asked is logged and skipped, and discovery logs when it stops at its error cap.Differs from #38133 only by leaving out the decision record and its two Javadoc citations:
2.0has nodocs/decisions/. The record lives onmain(docs/decisions/2026-11-18-workflow-node-factories-are-discovered-from-the-classpath.md).On
2.0this is what lets an upgrade from 2.0.7 or earlier redeploy the Collate workflows in the 2.0.8 step; a database already past that step does not run it again.Type of change:
Tests:
Unit tests
NodeFactoryRegistryTest(two discovery tests), run on this branch withNodeFactoryTestandNodeFactoryAIAutomationTest:Tests run: 12, Failures: 0, Errors: 0.Backend integration tests
--scope full) is pending.Manual testing performed
End-to-end
migrateon this branch, fresh MySQL: migrated, started the server once to seed 22 governance workflows, stopped it, then removed the 2.0.8 change-log row and the redeploy-step marker so the 2.0.8 redeploy runs again, as on an upgrade from 2.0.7 or earlier. Control (Collate jar copy without the services file):[v208] Redeployed 20 of 22withcreateAndRunAIAutomationTask is a Collate-only feature — handler not registeredandpolicyAgentTask is a Collate-only feature — handler not registered. With this change:Registering workflow node factories from io.collate.governance.workflows.CollateWorkflowNodeProvider→[v208] Redeployed 22 of 22, no errors.UI screen recording:
Not applicable — backend-only change.
Checklist:
REVIEW.md(one 🔴 on the decision record's scope, fixed; gitar and greptile findings fixed).