Skip to content

Keep upgrading past a plugin that left the registry - #13

Merged
oantoshchenko merged 1 commit into
mainfrom
fix/upgrade-removed-plugin
Oct 2, 2026
Merged

oantoshchenko merged 1 commit into
mainfrom
fix/upgrade-removed-plugin

Conversation

@oantoshchenko

Copy link
Copy Markdown
Contributor

Once the registry drops openmemory, atk upgrade --all on a home with openmemory installed stops at that plugin with Unexpected error: Plugin 'openmemory' not found in registry, exits 1, and never reaches the plugins after it in the manifest. This change reports the plugin and carries on.

Architecture: upgrade_plugin, the one changed function, sits between the two upgrade commands and the registry fetch, and hands registry errors back to the --all loop as UpgradeError

  • upgrade_plugin wraps the fetch to staging. The registry's PluginNotFoundError becomes an UpgradeError whose message names the fix, atk remove <dir>. An index entry whose directory is missing (RegistryFetchError) becomes an UpgradeError with the registry's own message.
  • Both upgrade commands handle UpgradeError and stay untouched. --all counts the failure, upgrades the remaining plugins, and exits 1 on every run until the plugin is removed. A skip with exit 0 would hide a plugin that can never upgrade again.

Sequence of atk upgrade --all with openmemory first in the manifest: in red the PluginNotFoundError that ends the run in main_cli, in green the UpgradeError, the counted failure, and the next plugin's upgrade

atk upgrade --all against a local registry that dropped removed-plugin, with healthy-plugin after it in the manifest:

✗ Failed to upgrade 'removed-plugin': Plugin 'removed-plugin' is no longer in the registry; remove it with 'atk remove removed-plugin'
✓ Upgraded plugin 'healthy-plugin'
✗ Upgrade complete: 1 upgraded, 1 failed

Three tests in tests/test_upgrade.py: one runs atk upgrade --all through the CLI and checks that the plugin after the removed one reaches its new ref, the summary line, and exit 1; two pin the exact message for each registry error. make check passes.

Known limit: released atk versions crash the same way, so this needs a release before the registry change merges.

Without this change, `atk upgrade --all` stops at the first installed
registry plugin that the registry index does not list:
registry.PluginNotFoundError escapes upgrade_all_plugins, main_cli prints
"Unexpected error", and every plugin after it in the manifest is skipped.
A plugin whose index entry outlives its directory (RegistryFetchError)
stops the run the same way.

upgrade_plugin turns both errors into UpgradeError, which both upgrade
commands handle: --all counts a failure, upgrades the remaining plugins
and exits 1, and the message names the command that removes the plugin.
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@oantoshchenko
oantoshchenko merged commit 9371ce3 into main Oct 2, 2026
4 checks passed
@oantoshchenko
oantoshchenko deleted the fix/upgrade-removed-plugin branch October 2, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant