<#10352 fix: update an existing plugin from the Hu...
# meltano-repo-activity
g
#10352 fix: update an existing plugin from the Hub when `meltano add` names its variant Pull request opened by ReubenFrankel Description
meltano add <plugin> --variant <variant>
does not update a plugin that is already in the project. It keeps the old definition, although the docs say that an update refreshes the lock file "the same as
meltano lock --update
would". This has been true since
meltano add --update
arrived in
3.3.0
(#8176). Since
3.9.0
, update is the default (#9391), so a plain
meltano add --variant
has the bug too.
meltano add
without
--variant
does update the plugin, so the result depends on whether the variant is named. The cause:
meltano add
reads the parent definition from
plugins/<type>/<name>--<variant>.lock
, and calls the Hub only when that file is missing. With
--variant
, the file exists. Without
--variant
, the lookup uses the placeholder
default
, that file never exists, and the Hub is called. •
ProjectAddService.add_with_flags
now gets the parent from the Hub when
update
is set. Custom and inherited plugins are skipped, as
meltano lock
skips them. A plugin that the Hub does not list gives the same "Check https://hub.meltano.com/" error as before. • A new test adds a plugin again with an explicit variant and a stale lock file, with and without a
meltano.yml
entry. The test fails without the fix, and passes with it. • The Python version tests in
test_add.py
now inject their plugin through the Hub, not through the lock file lookup. The
add
,
lock
, and core test suites show no new failures. Behaviour change:
meltano add
now contacts the Hub for every plugin that is not custom or inherited, even when a lock file exists. A lock file with no
meltano.yml
entry is replaced from the Hub.
meltano add
now fails for a plugin that the Hub does not list, where before it used the lock file. Checklist • I have read the contribution guide Was generative AI tooling used to co-author this PR? • Yes (please specify the tool below) Generated-by: Claude Code following the agentic coding guidelines Related Issues • #8110 asked to re-add a plugin to update it. #8176 added
--update
for it. • #9391 made
--update
the default. Summary by Sourcery Refresh existing plugin variants from the Hub during
meltano add
updates instead of reusing stale lock file definitions. Bug Fixes: • Refresh existing non-custom, non-inherited plugins from the Hub when
meltano add
updates a named variant, ensuring stale lock files are replaced with the current definition. • Report a consistent plugin-not-found error when an updated plugin is no longer listed in the Hub. Tests: • Add coverage for refreshing stale variant lock files both with and without a project plugin entry. • Update Python-version selection tests to mock Hub plugin lookup. --- 🤖 Generated with Claude Code meltano/meltano