Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to install extensions in workbench that fail to install from remote code-server #238815

Merged
merged 12 commits into from
Feb 11, 2025

Conversation

joshspicer
Copy link
Member

@joshspicer joshspicer commented Jan 27, 2025

related: microsoft/vscode-remote-release#9994 , microsoft/vscode-remote-release#5927 (comment) , microsoft/vscode-remote-release#9090 , microsoft/vscode-remote-release#9454 (comment)

Provides a way for the remote server to report back extensions that it could not install. The workbench can read this value and attempt to install these of extensions.

This is useful in cases when a remote does not have access to the marketplace, but a local machine does. This will effectively proxy the installation of an extension through the user's machine, closing several Remote - SSH issues

See demo below showing the end-to-end. This demo uses a modded Remote - SSH that will connect to a server pre-started on my local machine. That server process is blocked from accessing marketplace.visualstudio.com, causing an error to be thrown in the server

The workbench can reach the marketplace and is able to perform the installation.

b73d660:
https://github.com/user-attachments/assets/e39e04f1-2ac7-426c-b0e1-53f0905e9ba5

@sandy081
Copy link
Member

@joshspicer Thanks for the initiation. Instead of adding a new failed property, I would use the existing whenExtensionsReady method. Please change it to return all extension IDs or URIs that server should be initialised with. Eg:

whenExtensionsReady(): Promise<Array<string|URI>>

On the workbench, add a new contribution similar to

export class RemoteExtensionsInitializerContribution implements IWorkbenchContribution {
that installs extensions which are missing on the remote.

@joshspicer joshspicer changed the title [draft] Add failed() to IRemoteExtensionsScannerService [draft] Attempt to install extensions in workbench that cannot be installed from remote code-server Jan 27, 2025
@joshspicer joshspicer changed the title [draft] Attempt to install extensions in workbench that cannot be installed from remote code-server [draft] Attempt to install extensions in workbench that fail to install from remote code-server Jan 27, 2025
@sandy081 sandy081 added this to the February 2025 milestone Jan 28, 2025
@joshspicer joshspicer force-pushed the joshspicer/whip-burst branch from 956cbd4 to 4cf3940 Compare February 7, 2025 01:59
@joshspicer joshspicer requested a review from sandy081 February 7, 2025 02:05
@joshspicer joshspicer changed the title [draft] Attempt to install extensions in workbench that fail to install from remote code-server Attempt to install extensions in workbench that fail to install from remote code-server Feb 7, 2025
@joshspicer
Copy link
Member Author

joshspicer commented Feb 7, 2025

Demo

demo2.mov

Notes

  • Remote - SSH directly connects to the code-server instance hardcoded on port 25565
  • The code-server process cannot reach marketplace.visualstudio.com. (Blocked for only that program via firewall utility)
image
  • I've simulated a "failed" VSIX installation on the server-side by appending .BROKEN to the file name on startup and re-naming before the workbench connects.
    • This is a bit contrived, but I wanted to show that this functionality indeed works

@joshspicer joshspicer marked this pull request as ready for review February 7, 2025 02:15
Copy link

⚠️ This PR originates from a fork. Due to security restrictions, pipelines from forks are no longer triggered automatically. Learn more.

If the changes appear safe, you can manually trigger the pipeline by commenting /AzurePipelines run.

Copy link
Member

@sandy081 sandy081 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comments

@joshspicer joshspicer requested a review from sandy081 February 10, 2025 19:14
sandy081
sandy081 previously approved these changes Feb 11, 2025
Copy link
Member

@sandy081 sandy081 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since, I will be not available from tomorrow, I would like to unblock you by giving the approval assuming that you will take care of the review feedback.

Thanks

joshspicer and others added 9 commits February 11, 2025 11:02
Provides a way for the remote server to report back to the workbench a
set of extensions that it could not install.  The workbench will
then attempt to install the set of extensions.

This is useful in cases when a remote does not have access to the
marketplace, but a local machine does.  This will effectively proxy
the installation of an extension through the user's machine.
@joshspicer
Copy link
Member Author

changes from last review: 5a401fa

@joshspicer joshspicer merged commit 8c1ac62 into microsoft:main Feb 11, 2025
7 checks passed
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.

3 participants