Skip to content

[2.0] Discover workflow node factories from the classpath so migrate builds distribution nodes (backport 2.0 #38133) - #38141

Merged
yan-3005 merged 1 commit into
2.0from
fix/discover-workflow-node-factories-2.0
Nov 18, 2026
Merged

yan-3005 merged 1 commit into
2.0from
fix/discover-workflow-node-factories-2.0

Conversation

@yan-3005

@yan-3005 yan-3005 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #38133 to 2.0. Companion Collate backport: open-metadata/openmetadata-collate#8693

migrate runs 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 26 on Collate clusters). NodeFactoryRegistry now registers every NodeFactoryProvider listed in META-INF/services when 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.0 has no docs/decisions/. The record lives on main (docs/decisions/2026-11-18-workflow-node-factories-are-discovered-from-the-classpath.md).

On 2.0 this 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:

  • Improvement

Tests:

Unit tests

NodeFactoryRegistryTest (two discovery tests), run on this branch with NodeFactoryTest and NodeFactoryAIAutomationTest: Tests run: 12, Failures: 0, Errors: 0.

Backend integration tests

  • Not applicable (no backend API changes). Broader affected coverage (--scope full) is pending.

Manual testing performed

End-to-end migrate on 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 22 with createAndRunAIAutomationTask is a Collate-only feature — handler not registered and policyAgentTask 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:

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.
@yan-3005
yan-3005 requested a review from a team as a code owner November 18, 2026 14:52
@yan-3005
yan-3005 requested review from manerow and removed request for a team November 18, 2026 14:52
@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.

@gitar-bot

gitar-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Classpath 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 migrate builds distribution-only nodes, fixing the 2.0.8 governance workflow redeploy that failed with Redeployed 24 of 26. NodeFactoryRegistry now loads every NodeFactoryProvider listed in META-INF/services on first use, skipping and logging providers that fail to load. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

Comment on lines +92 to +94
NodeFactoryRegistry registry = NodeFactoryRegistry.discover(loader);

Optional<NodeInterface> result =

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.

P2 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!

@yan-3005 yan-3005 added the skip-pr-checks Bypass PR metadata validation check label Nov 18, 2026
@yan-3005
yan-3005 merged commit 4050c60 into 2.0 Nov 18, 2026
64 of 73 checks passed
@yan-3005
yan-3005 deleted the fix/discover-workflow-node-factories-2.0 branch November 18, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants