Enable extensions marketplace in workspace
What does this MR do and why?
Issue: Rails: add support for enabling marketplace in ... (#438491 - closed)
Corresponding gitlab-web-ide-vscode-fork issue: editor-injector: add extensions gallery to prod... (gitlab-web-ide-vscode-fork#20 - closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Context | Before | After |
---|---|---|
Opening the extensions tab inside the workspace |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Create a workspace. Let's call it W1.
- Enable the feature flag for the root group of the agent project by running the following command in the rails console (update the group ID in the query as per your environment)
Feature.enable(:allow_extensions_marketplace_in_workspace, Group.find(22))
- Create a workspace. Let's call it W2.
- Open the workspace URL and open a terminal and verify the value of
echo ${GL_EDITOR_ENABLE_MARKETPLACE}
. For W1, the value will befalse
and for W2, the value will betrue
. - Running the command
cat /project/.gl-editor/code-server/product.json
in the terminal- For W1, there should be no key called
extensionsGallery
in this output. - For W2, verify that the extensions marketplace for VS Code injected is pointing to Open VSX by inspecting the presence of the key
extensionsGallery
- For W1, there should be no key called
- On the left panel of VS Code, choose the "Extensions" and try searching for an extension. For W1, you will not be able to. For W2, you will be able to browse/install/remove extensions.
- Bonus - if your repository already has
.vscode/extensions.json
committed, VS Code will give you a popup to install the recommended extensions for W2. Here's an example for that file. Commit this file to the default branch of the project and create a workspace again with the feature flag enabled. Open up the workspace URL and you should see a pop-up at the bottom right asking you if you want to install the recommended extensions.
{
"recommendations": [
"hilleer.yaml-plus-json",
"bungcip.better-toml"
]
}
Edited by Vishal Tak