Skip to content

Manage install from vsix#17

Closed
RomanNikitenko wants to merge 5 commits into
mainfrom
manage-install-from-vsix
Closed

Manage install from vsix#17
RomanNikitenko wants to merge 5 commits into
mainfrom
manage-install-from-vsix

Conversation

@RomanNikitenko

@RomanNikitenko RomanNikitenko commented Apr 2, 2025

Copy link
Copy Markdown
Owner

What does this PR do?

Adds the ability to disable 'Install from VSIX' command.
It uses Config Map approach. The ConfigMap should be created in the eclipse-che namespace, see https://eclipse.dev/che/docs/stable/administration-guide/configuring-a-user-namespace/

I tested if it's possible to override the configuration in user's namespace when the ConfigMap is created in the eclipse-che namespace:

Edit_ConfigMap.mov

What issues does this PR fix?

https://issues.redhat.com/browse/CRW-8313

How to test this PR?

Prerequisites

  • Add a ConfigMap with a configuration for the Install from VSIX command.
    The best way for testing - adding of the ConfigMap in the eclipse-che namespace. In this case the ConfigMap is replicated to every user namespace. The content is:
kind: ConfigMap
apiVersion: v1
metadata:
  name: vscode-editor-configurations
  namespace: eclipse-che
  labels:
    app.kubernetes.io/part-of: che.eclipse.org
    app.kubernetes.io/component: workspaces-config
    controller.devfile.io/mount-to-devworkspace: 'true'
    controller.devfile.io/watch-configmap: 'true'
  annotations:
    controller.devfile.io/mount-as: file
    controller.devfile.io/mount-path: /checode-config
    controller.devfile.io/read-only: 'true'
data:
  configurations.json: |
    {
      "extensions.install-from-vsix-enabled": false
    }

If you prefer to add the ConfigMap directly in your namespace, the content is:

kind: ConfigMap
apiVersion: v1
metadata:
  name: vscode-editor-configurations
  labels:
    controller.devfile.io/mount-to-devworkspace: 'true'
    controller.devfile.io/watch-configmap: 'true'
  annotations:
    controller.devfile.io/mount-as: file
    controller.devfile.io/mount-path: /checode-config
    controller.devfile.io/read-only: 'true'
data:
  configurations.json: |
    {
      "extensions.install-from-vsix-enabled": false
    }
  • Add the following configmap to your namespace:
kind: ConfigMap
apiVersion: v1
metadata:
  name: default-extensions
  labels:
    controller.devfile.io/mount-to-devworkspace: 'true'
    controller.devfile.io/watch-configmap: 'true'
  annotations:
    controller.devfile.io/mount-as: env
data:
  DEFAULT_EXTENSIONS: '/tmp/atlassian.atlascode-3.0.10.vsix;/tmp/snowflake.snowflake-vsc-1.9.1.vsix'

Use cases for testing:

Command Palette does not contain "Install from VSIX" command
  • F1 => start typing Install from
  • check list of the filtered commands
  • Install from VSIX command should be absent

image

"Extensions" panel does not contain "Install from VSIX" action
  • F1 => Open View => Extensions
  • click ... on the view (Views and More Actions)
  • Install from VSIX action should be absent

image

"Install Extension VSIX" action should be absent in the Explorer's context menu
  • Go to the Explorer
  • find a file with the vsix extension
  • open the context menu for that file
  • Install from VSIX action should be absent

image

It's not possible to install VSIX extensions using "default extensions" functionality image
  • No installed extensions in the Extensions panel
image

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
…d of ConfigMap

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@github-actions

github-actions Bot commented Apr 2, 2025

Copy link
Copy Markdown

Click here to review and test in web IDE: Contribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant