Skip to content

Switch from catalog to index download#355

Open
chennes wants to merge 1 commit intoFreeCAD:devfrom
chennes:switchToIndex
Open

Switch from catalog to index download#355
chennes wants to merge 1 commit intoFreeCAD:devfrom
chennes:switchToIndex

Conversation

@chennes
Copy link
Member

@chennes chennes commented Feb 11, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 11, 2026 04:46
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

This pull request attempts to switch the Addon Manager from downloading the curated addon catalog to downloading the full addon index. According to comments in the codebase, the index file is intended for versions of the Addon Manager after 2026-01-24, and contains all addons (both curated and uncurated), while the catalog file only contains curated addons for older versions.

Changes:

  • Updated the default URL for addon_catalog_cache_url from addon_catalog_cache.zip to addon_index_cache.zip

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chennes chennes requested a review from Copilot February 11, 2026 18:30
@chennes chennes force-pushed the switchToIndex branch 2 times, most recently from ee11a51 to b8e4ed2 Compare February 11, 2026 18:38
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +97 to +103
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() will keep running on every startup for users who previously set a custom addon_catalog_cache_url (since the old value stays non-"obsolete"). That means it will repeatedly overwrite any user-chosen addon_index_cache_url and re-print warnings each run. Make this migration one-time (e.g., only migrate when addon_index_cache_url is still the default, and/or mark the old key as obsolete after copying, or add an explicit migration flag) so it doesn’t clobber later user configuration.

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")
if not old_catalog_url or old_catalog_url.startswith("obsolete"):
return # Nothing to migrate, it was never set to anything else or was already migrated
fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n")
fci.Console.PrintWarning(f"URL: {old_catalog_url}\n")
prefs.set("addon_index_cache_url", old_catalog_url)
# Mark the old key as obsolete so this migration only runs once and does not
# overwrite any future user configuration of addon_index_cache_url.
prefs.set("addon_catalog_cache_url", f"obsolete:{old_catalog_url}")

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