Skip to content

[CLI] extension update command#199893

Merged
sandy081 merged 7 commits intomicrosoft:mainfrom
samhanic:cli-extension-update
Jan 8, 2024
Merged

[CLI] extension update command#199893
sandy081 merged 7 commits intomicrosoft:mainfrom
samhanic:cli-extension-update

Conversation

@samhanic
Copy link
Contributor

@samhanic samhanic commented Dec 3, 2023

This PR adds a cli command to update all extensions code --list-extensions , which works without opening VSCode as GUI.
This fixes the issue #56578 .

For reference, this is the following of the ticket re-opening after the discussion in this issue #196155 (comment) .

This have been linted using yarn and tested with the provided test.sh script.
I also tested that with classic extensions, but due to difficulties to test, I have not tested any prerelease upgrades, and not tested with vscode server. For prerelease, as soon as I will have some outdated one in my test setup I will be able to update this comment accordingly.
I am also not a TypeScript developer so if I wrote someting not optimal in the language, don't hesitate to state it below.

@samhanic samhanic changed the title Cli extension update Dec 3, 2023
@sandy081 sandy081 self-requested a review December 4, 2023 10:08
@sandy081
Copy link
Member

sandy081 commented Dec 4, 2023

@connor4312 Can you please check the changes in rust CLI part?

Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com>
@connor4312
Copy link
Member

Rust changes look ok 👍

@samhanic
Copy link
Contributor Author

samhanic commented Dec 6, 2023

@sandy081 Thank you for the review, I made the consequent changes

I had one problem of name collision: InstallExtensionInfo is defined twice: in extensionManagementCLI.ts and in extensionManagement.ts . It was not seen before because each definition did not interfered with each other, but it caused issue to use this.extensionManagementService.installGalleryExtensions API.

Because this is not the goal of this PR to resolve the issue, I choosed the simplest solution and renamed the one in extensionManagementCLI.ts to CLIInstallExtensionInfo , but this could be the topic of a refactoring.

@sandy081
Copy link
Member

sandy081 commented Jan 3, 2024

I choosed the simplest solution and renamed the one in extensionManagementCLI.ts to CLIInstallExtensionInfo , but this could be the topic of a refactoring.

This is ok for me. Let me know once you have incorporated all changes.

@samhanic
Copy link
Contributor Author

samhanic commented Jan 3, 2024

I already incorporated all changes you requested, so if renaming as CLIInstallExtensionInfo works for you, from what I see it should be ready to merge

@sandy081
Copy link
Member

sandy081 commented Jan 7, 2024

LGTM, can you please resolve the merge conflicts?

@sandy081 sandy081 added this to the December / January 2024 milestone Jan 7, 2024
@sandy081 sandy081 enabled auto-merge January 8, 2024 05:56
@sandy081 sandy081 merged commit 99e16e6 into microsoft:main Jan 8, 2024
@samhanic
Copy link
Contributor Author

Verified with latest build of code-insiders: the update seems working, but prints a DepreciationWarning (probably inside the extensionManagementService.installGalleryExtensions function):

code-insiders --update-extensions
Updating extensions: ms-toolsai.jupyter, ms-vscode.cpptools, redhat.java
(node:12027) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `code-insiders --trace-deprecation ...` to show where the warning was created)
Extension 'ms-vscode.cpptools' v1.19.1 was successfully updated.
Extension 'ms-toolsai.jupyter' v2024.1.2024011201 was successfully updated.
Extension 'redhat.java' v1.27.2024011208 was successfully updated.

Tested on Ubuntu 20.04 , code-insiders installed with snap.
I'm commenting here because the corresponding issue have conversation limited to collaborators.

@sandy081
Copy link
Member

but prints a DepreciationWarning (probably inside the extensionManagementService.installGalleryExtensions function):

This is being tracked separately. Tagging this as verified based on above comment

@starball5
Copy link

Does this update all extensions? or only all the extensions for the specified profile (--profile) / the default if no profile is specified?

@sandy081
Copy link
Member

Profile should be passed to update for a specific profile, otherwise extensions from default profile are updated.

@microsoft microsoft locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants