Add settings for custom gallery extension URLs#14647
Open
jstruzik wants to merge 2 commits into
Open
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).
|
Thank you for this PR! We ask that you sign our Contributor License Agreement before we accept your contribution. You can sign the CLA by posting a comment on this PR saying: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.