Skip to content

Add Extensions Marketplace in Web IDE

Paul Slaughter requested to merge ps-extensions-marketplace-web-ide into master

Issue: Create User-Level Extension Marketplace settings (#451875)

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
Screenshot_2024-05-06_at_8.12.58_AM Screenshot_2024-05-06_at_8.11.58_AM Screenshot_2024-05-06_at_8.12.20_AM

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
Screenshot_2024-05-06_at_8.15.10_AM Screenshot_2024-05-06_at_8.14.43_AM Screenshot_2024-05-06_at_8.14.19_AM

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 VSCode expects to be able to use 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:

  1. Visit User Preferences page at /-/profile/preferences/
  2. Under Integrations, the Extensions Marketplace checkbox should not be present.

In Web IDE:

  1. Visit the Web IDE for any project.
  2. 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:

  1. Visit User Preferences page at /-/profile/preferences/
  2. Under Integrations, the Extensions Marketplace checkbox should be present.
  3. Click the Enable Extensions Marketplace checkbox and a Third-Party Acknowledgement modal should appear.
  4. Click I Understand and the checkbox should be checked now.
  5. Click Save Changes.

In Web IDE:

  1. Visit the Web IDE for any project.
  2. Go to Views > Extensions.
  3. You should be able to use the extensions marketplace 🎉

Known issues

Edited by Paul Slaughter

Merge request reports