Skip to content

Update to version 2026.2.11dev#356

Open
chennes wants to merge 2 commits intoFreeCAD:devfrom
chennes:version20260211dev
Open

Update to version 2026.2.11dev#356
chennes wants to merge 2 commits intoFreeCAD:devfrom
chennes:version20260211dev

Conversation

@chennes
Copy link
Member

@chennes chennes commented Feb 12, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 12, 2026 04:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.xml version/date to 2026.2.11dev (2026-02-11).
  • Switch cache usage from addon_catalog to addon_index, including new preference defaults and a migration helper.
  • Update unit tests and ZIP URL derivation to use the new addon_index_cache_url preference.

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.

Comment on lines +97 to +102
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)
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +103
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)

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +103
@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)

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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