Add settings for custom gallery extension URLs - #14685
Conversation
Add a Custom option to the extension gallery source setting plus a Custom Gallery Url setting. Presets and custom URLs derive their full gallery endpoints from one deriveGalleryConfig() (single source of truth); base URLs are canonicalized (credentials, query, and fragment are rejected). An advisory probe validates the configured gallery on startup and on change (debounced, warn-once, credential-safe). The restart prompt fires only when the resolved gallery actually changes.
extensionGalleryService's resource (unpkg) API used the product default gallery (product.json, i.e. p3m.dev) as a hard-coded fallback, so a request that failed against a non-default gallery selected via positron.extensions.gallerySource -- a custom or Open VSX gallery -- silently leaked to the default gallery. For example, a custom gallery returning 5xx would fall back to p3m.dev and serve its extensions instead. Only use the product fallback when it targets the same gallery host as the resolved resource (sameGalleryHost).
|
All contributors have signed the CLA ✍️ ✅ |
|
E2E Tests 🚀 |
PETE's assessment 🧪Verdict: 🟢 Adequate -- Every substantive new unit ( What changed
Tests in this PR
Existing coverage
Suggested additionsNone required. Optional hardening: extend Deployment note (optional)The restart-gating logic is duplicated across the PETE (Positron Extreme Test Experiment) - LLM-based test-coverage advisor, in pilot. Triggers on PR open and on |
|
I have read the CLA Document and I hereby sign the CLA |
|
Requesting @timtmok for a review since I think you've worked in this area the most? Feel free to reassign as needed! |
This PR does two things:
EXTENSIONS_GALLERYenvironment variable (see EXTENSIONS_GALLERY is ignored when trying to set a custom gallery URL #13415)Customoption activates a newCustom Gallery Urlsetting. Both the built-in presets and the custom URL now derive their full gallery endpoints from a single base URL through onederiveGalleryConfig()helper, so the Open VSX URL scheme lives in one place and presets and custom URLs cannot drift.extensionGalleryServiceused the product-default gallery as a hard-coded fallback, so a request that failed against a non-default gallery would silently leak to the default gallery.Here are some screenshots of the configuration and a request going through:


Release Notes
New Features
Bug Fixes
Validation Steps
https://open-vsx.org/vscode. Restart, open the Extensions view, and confirm extensions load from the configured galleryhttps://nope.invalid/vscode) and confirm a single warning notification (no spam while typing); enterhttps://user:pass@host/vscodeand confirm it is rejected with no credentials shown.p3m.dev(check the Network tab / Dev Tools); the failure stays within the configured gallery.EXTENSIONS_GALLERYis set to a valid value, confirm changing the settings shows the "environment variable is overriding" notification and does not restart.