Skip to content

Commit 7bd6fd9

Browse files
iamaeroplaneclaude
andcommitted
fix(extensions): check _install_allowed for updates, preserve backup on failed rollback
- Skip automatic updates for extensions from catalogs with install_allowed=false - Only delete backup directory on successful rollback, preserve it on failure for manual recovery Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 92dcf9f commit 7bd6fd9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/specify_cli/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,6 +2674,11 @@ def extension_update(
26742674
console.print(f"⚠ {ext_id}: Not found in catalog (skipping)")
26752675
continue
26762676

2677+
# Check if installation is allowed from this catalog
2678+
if not ext_info.get("_install_allowed", True):
2679+
console.print(f"⚠ {ext_id}: Updates not allowed from '{ext_info.get('_catalog_name', 'catalog')}' (skipping)")
2680+
continue
2681+
26772682
catalog_version = pkg_version.Version(ext_info["version"])
26782683

26792684
if catalog_version > installed_version:
@@ -2850,12 +2855,12 @@ def extension_update(
28502855
manager.registry.restore(extension_id, backup_registry_entry)
28512856

28522857
console.print(f" [green]✓[/green] Rollback successful")
2858+
# Clean up backup directory only on successful rollback
2859+
if backup_base.exists():
2860+
shutil.rmtree(backup_base)
28532861
except Exception as rollback_error:
28542862
console.print(f" [red]✗[/red] Rollback failed: {rollback_error}")
2855-
2856-
# Clean up backup directory after rollback attempt
2857-
if backup_base.exists():
2858-
shutil.rmtree(backup_base)
2863+
console.print(f" [dim]Backup preserved at: {backup_base}[/dim]")
28592864

28602865
# Summary
28612866
console.print()

0 commit comments

Comments
 (0)