Add Extensions Marketplace in Web IDE
Issue: Create User-Level Extension Marketplace settings (#451875 - closed)
Depends on: feat: Add extensionsGallerySettings to config (gitlab-web-ide!307 - merged)
What does this MR do and why?
This MR introduces the web_ide_extensions_marketplace
feature flag and hardcodes some settings that will work for .com
. In an upcoming iteration, we will abstract these settings into an instance-wide configuration so that GitLab admins can configure their instance to point to their own extensions marketplace.
Because the extensions marketplace could come from a third-party we must require opt-in from the user. This wording and behavior has been confirmed by legal in this issue.
Screenshots or screen recordings
In User Preferences:
With web_ide_extensions_marketplace disabled |
With web_ide_extensions_marketplace enabled |
Third-party notice |
---|---|---|
In Web IDE:
With web_ide_extensions_marketplace disabled |
With web_ide_extensions_marketplace enabled but opt in unset |
With marketplace enabled for user and instance |
---|---|---|
Demo:
web_ide_extensions_marketplace_demo
How to set up and validate locally
IMPORTANT! Workhorse needs to be updated to send CORS headers for /assets/webpack
. This is not an issue for .com
and doesn't block this MR, but the extensions marketplace will break the Web IDE if this isn't set in the GDK.
With the gdk
running, under the gitlab
folder, run the following to update workhorse
to be compatible with the extensions sandbox:
ALSO IMPORTANT! You will need to enable the web_ide_oauth
flag as well.
ALSO ALSO IMPORTANT! With web_ide_oauth
enabled crypto.subtle
browser utils which require a secure context (either localhost
or https://
).
# Apply the workhorse changes
curl https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152070.diff | git apply
# Rebuild workhorse
cd workhorse && make && cd ..
# Restart workhorse in gdk
gdk restart workhorse
With `web_ide_extensions_marketplace` flag off
In User Preferences:
- Visit User Preferences page at
/-/profile/preferences
/ - Under Integrations, the Extensions Marketplace checkbox should not be present.
In Web IDE:
- Visit the Web IDE for any project.
- Go to Views > Extensions, you should see a friendly "Extensions Marketplace disabled" message with a link to the help page.
With `web_ide_extensions_marketplace` flag on
In User Preferences:
- Visit User Preferences page at
/-/profile/preferences
/ - Under Integrations, the Extensions Marketplace checkbox should be present.
- Click the Enable Extensions Marketplace checkbox and a Third-Party Acknowledgement modal should appear.
- Click I Understand and the checkbox should be checked now.
- Click Save Changes.
In Web IDE:
- Visit the Web IDE for any project.
- Go to Views > Extensions.
- You should be able to use the extensions marketplace
🎉