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

[CLI] extension update command #199893

Merged
merged 7 commits into from
Jan 8, 2024
Merged

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 [CLI] extension update command Dec 3, 2023
@sandy081 sandy081 self-requested a review December 4, 2023 10:08
resources/completions/zsh/_code Outdated Show resolved Hide resolved
src/vs/platform/environment/node/argv.ts Outdated Show resolved Hide resolved
cli/src/commands/args.rs Outdated Show resolved Hide resolved
@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 <[email protected]>
@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 merged commit 99e16e6 into microsoft:main Jan 8, 2024
6 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants