<#9567 refactor: Make Hub client an implementation...
# meltano-repo-activity
g
#9567 refactor: Make Hub client an implementation detail of lockfile mechanism Pull request opened by edgarrmondragon on <!date^1760472281^{date_short}|2025-10-14T20:04:41Z> Previously, the Hub was a
DefinitionSource
that could be queried at runtime to fetch plugin definitions. This refactoring makes the Hub client an internal implementation detail of the plugin locking mechanism, ensuring that all plugin definitions are resolved from lockfiles at runtime. Key changes: • Remove
HUB
from
DefinitionSource
enum • Update
PluginLockService
to fetch definitions from Hub when creating lockfiles • Modify
project_add_service
to create lockfiles before resolving parents • Update
find_parent()
to no longer query Hub as a fallback source • Inherited plugins now properly use INHERITED source without requiring lockfiles • Lock command simplified to use lock service's Hub integration • Handle variant resolution for lockfiles when variant is "default" or None Benefits: • Cleaner separation of concerns: Hub is only for locking, not runtime resolution • More predictable plugin resolution: lockfiles are the single source of truth • Inherited plugins work correctly without requiring their own lockfiles • Reduces complexity by removing Hub-specific code from runtime paths All affected tests updated to reflect the new architecture. 🤖 Generated with Claude Code Co-Authored-By: Claude noreply@anthropic.com ## Description ## Related Issues • Closes #XXXX ## Summary by Sourcery Refactor plugin resolution to centralize on lockfiles by removing runtime Hub queries and making the Hub client an internal detail of the locking process. New Features: • Introduce PluginDefinitionNotLockedException and add ProjectPluginsService.lock for explicit plugin locking. • Add a fetch_from_hub flag to PluginLockService.save and propagate it through the CLI lock command. Bug Fixes: • Ensure inherited plugins resolve correctly via INHERITED source without requiring their own lockfiles. Enhancements: • Remove HUB from DefinitionSource and eliminate runtime Hub fallbacks, enforcing lockfiles as the single source of truth. • Pre-lock non-custom, non-inherited plugins in ProjectAddService to ensure lockfiles exist before resolving parent plugins. • Extend LockedDefinitionService to handle default or None variants by selecting the first available lockfile. Tests: • Remove Hub network calls during runtime resolution and expect PluginDefinitionNotLockedException where appropriate. • Update fixtures and CLI tests to pre-lock plugins and align test assertions with the new locking behavior. meltano/meltano