Conversation
There was a problem hiding this comment.
Pull request overview
Updates Addon Manager to the 2026.2.11dev development version and switches startup/cache handling from the legacy “addon catalog” cache to the newer “addon index” cache, including a preferences migration and related test updates.
Changes:
- Bump
package.xmlversion/date to 2026.2.11dev (2026-02-11). - Switch cache usage from
addon_catalogtoaddon_index, including new preference defaults and a migration helper. - Update unit tests and ZIP URL derivation to use the new
addon_index_cache_urlpreference.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.xml | Version/date bump to 2026.2.11dev. |
| addonmanager_workers_startup.py | Loads addon_index cache and adds migration from old catalog URL preference. |
| addonmanager_preferences_defaults.json | Introduces addon_index_cache_url + new hash key; marks old catalog URL pref as obsolete. |
| AddonManagerTest/app/test_workers_startup.py | Updates tests for new cache keys and adds migration tests. |
| Addon.py | ZIP URL derivation now uses addon_index_cache_url when relative_cache_path is present. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| old_catalog_url = fci.Preferences().get("addon_catalog_cache_url") | ||
| if old_catalog_url.startswith("obsolete"): | ||
| return # Nothing to migrate, it was never set to anything else | ||
| fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n") | ||
| fci.Console.PrintWarning(f"URL: {old_catalog_url}\n") | ||
| fci.Preferences().set("addon_index_cache_url", old_catalog_url) |
There was a problem hiding this comment.
migrate_catalog_to_index() copies addon_catalog_cache_url directly into addon_index_cache_url. If a user previously pointed addon_catalog_cache_url at an .../addon_catalog_cache.zip, the startup code will then download that ZIP as the index and fail because it won’t contain addon_index_cache.json. Consider translating well-known catalog URLs (e.g. replacing addon_catalog_cache.zip with addon_index_cache.zip) and/or only migrating when the old value is truly custom vs the prior default.
| old_catalog_url = fci.Preferences().get("addon_catalog_cache_url") | |
| if old_catalog_url.startswith("obsolete"): | |
| return # Nothing to migrate, it was never set to anything else | |
| fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n") | |
| fci.Console.PrintWarning(f"URL: {old_catalog_url}\n") | |
| fci.Preferences().set("addon_index_cache_url", old_catalog_url) | |
| prefs = fci.Preferences() | |
| old_catalog_url = prefs.get("addon_catalog_cache_url") | |
| # Nothing to migrate if the old value was never set or explicitly marked obsolete | |
| if not old_catalog_url or old_catalog_url.startswith("obsolete"): | |
| return | |
| # Do not overwrite an existing, non-obsolete index URL | |
| existing_index_url = prefs.get("addon_index_cache_url") | |
| if existing_index_url and not existing_index_url.startswith("obsolete"): | |
| return | |
| # Translate well-known catalog ZIP filenames to the corresponding index ZIP filenames | |
| new_index_url = old_catalog_url | |
| catalog_suffix = "addon_catalog_cache.zip" | |
| index_suffix = "addon_index_cache.zip" | |
| if old_catalog_url.endswith(catalog_suffix): | |
| new_index_url = old_catalog_url[: -len(catalog_suffix)] + index_suffix | |
| fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n") | |
| fci.Console.PrintWarning(f"URL: {new_index_url}\n") | |
| prefs.set("addon_index_cache_url", new_index_url) |
| def migrate_catalog_to_index(): | ||
| old_catalog_url = fci.Preferences().get("addon_catalog_cache_url") | ||
| if old_catalog_url.startswith("obsolete"): | ||
| return # Nothing to migrate, it was never set to anything else | ||
| fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n") | ||
| fci.Console.PrintWarning(f"URL: {old_catalog_url}\n") | ||
| fci.Preferences().set("addon_index_cache_url", old_catalog_url) | ||
|
|
There was a problem hiding this comment.
After migrating, the old addon_catalog_cache_url value is left intact. That means this migration will run (and warn) on every startup and can keep overwriting a user’s addon_index_cache_url if they later customize it. Consider clearing/removing addon_catalog_cache_url (or setting it to the new "obsolete" marker / storing a one-time migration flag) after a successful migration so it’s idempotent and doesn’t spam warnings.
| @staticmethod | ||
| def migrate_catalog_to_index(): | ||
| old_catalog_url = fci.Preferences().get("addon_catalog_cache_url") | ||
| if old_catalog_url.startswith("obsolete"): | ||
| return # Nothing to migrate, it was never set to anything else | ||
| fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n") | ||
| fci.Console.PrintWarning(f"URL: {old_catalog_url}\n") | ||
| fci.Preferences().set("addon_index_cache_url", old_catalog_url) | ||
|
|
There was a problem hiding this comment.
The new migration path isn’t fully covered by tests for the important edge cases: (1) a stored old value equal to the previous default catalog URL should not be treated as "custom", and (2) a custom URL ending in addon_catalog_cache.zip should be translated to the index filename (if that’s the intended behavior), and (3) the old key should be cleared so migration is one-time. Adding focused unit tests for these cases would prevent regressions.
No description provided.