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] --list-extensions --show-versions should annotate the packages that are in pre-release #196155

Closed
SteveLauC opened this issue Oct 21, 2023 · 13 comments
Assignees
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@SteveLauC
Copy link

Context

In Topgrade, we are using the following commands to update VS Code extensions:

$ code --list-extensions

# Then for the extensions listed, update them with:
$ code --install-extensions --force <EXTENSION ID>

This won't work if you have an extension that is in pre-release:

$ topgrade --only vscode
...
Can't install release version of 'ms-python.debugpy' extension because it has no release version.
Failed Installing Extensions: ms-python.debugpy

code has an option --pre-release that could be used with --install-extensions to install the pre-release version of an extension, but before using it, we need to know which extensions are in pre-release, then we tried the --show-versions option, unfortunately, it won't tell you that:

➜  code --list-extensions --show-versions | grep python
filwaline.vscode-postfix-python@0.1.3
ms-python.black-formatter@2023.4.1
ms-python.debugpy@2023.3.12921009
ms-python.python@2023.18.0
ms-python.vscode-pylance@2023.10.30

well, it seems vscode cli does not distinguish pre-release version and the release version.

Requested Feature

$ code --list-extensions --show-versions

should tell us what extensions are in pre-release

Topgrade Issue

pre-release version of vscode extension update error

@sandy081 sandy081 added feature-request Request for new features or functionality extensions Issues concerning extensions labels Oct 23, 2023
@sandy081 sandy081 added this to the Backlog milestone Oct 23, 2023
@sandy081 sandy081 added the help wanted Issues identified as good community contribution opportunities label Oct 23, 2023
@N1kO23
Copy link
Contributor

N1kO23 commented Oct 23, 2023

I'd be interested in working on this. What would be the desired indication for a package to be pre-release?
Something among the lines of filwaline.vscode-postfix-python@0.1.3 (pre-release) perhaps?

@SteveLauC
Copy link
Author

I'd be interested in working on this. What would be the desired indication for a package to be pre-release? Something among the lines of filwaline.vscode-postfix-python@0.1.3 (pre-release) perhaps?

Thanks for your interest in implementing this feature, for me, as long as its format is parsable and can be used to distinguish between different extension types, it is acceptable

From the VS Code side, I think the format should be standardized and support all the extension types, it seems that VS Code supports the following extension types:

  1. From the marketplace (published)
    1. Release
    2. Pre-release
  2. Not published

Though I am not a VS Code user so the above summary could be wrong

@sandy081
Copy link
Member

I would stick just showing if the extension is a pre-release or not and not the type of the extension.

@SteveLauC
Copy link
Author

Then what about we split #197963 into 2 PRs, one for the question originally stated in this issue's description, one for the question mentioned in this comment?

@sandy081
Copy link
Member

I am not convinced about the second request yet. Lets focus on the first one which is reasonable.

@SteveLauC
Copy link
Author

I am not convinced about the second request yet.

Willing to elaborate on it a bit?

@sandy081
Copy link
Member

I do not see a necessity to inform if the extension is coming from the Marketplace or as a VSIX.

@SteveLauC
Copy link
Author

Frankly, I asked for a reason in my last comment, you didn't answer it, you simply say you don't like it.

An open source community should not work like this. It is total fine that we disagree on something, but we need at least a reason.

Anyway, you are the maintainer, you decide.

@sandy081
Copy link
Member

I gave my reason that I do not see a necessity of this. In order to accept new features and contributions we should need a proper reason, requirement and if it is worth a feature to accept it. Since I do not see such I am not in favour. Hope this explains.

@SteveLauC
Copy link
Author

I gave my reason that I do not see a necessity of this. In order to accept new features and contributions we should need a proper reason, requirement and if it is worth a feature to accept it. Since I do not see such I am not in favour. Hope this explains.

Ok

Would this suffice?

topgrade-rs/topgrade#593

Another issue that code --install-extension cannot handle, just like the one described in this issue

@samhanic
Copy link
Contributor

Seeing this discussion becoming a standoff, I think it would be useful to clearly add a bit of context here.

I developed some time ago on the system-wide updater Topgrade, the feature to update vscode extensions from the marketplace.
Knowing that Vscode has no direct upgrade command, we need to:

  • get list of installed extensions with code --list-extensions (obtain a line-return separated list of installed extensions)
  • construct the upgrade command and execute it
      - code --force --install-extension [ext0] --install-extension [ext1] ... --install-extension [extN]

This works very well for most of the extensions, but few corner cases are not handled by this process, and were reported by users, in order:

To fix the first one, the maintainer of Topgrade, SteveLauC, have created this issue, and when the second one was reported, it was also stated within this comment. To be complete, the third one has been stated much more recently so it was not stated in this thread.

This means that, for the CLI to correctly allow extensions management, there is a necessity to properly differentiate the extensions origin/types/status (whatever we want to call that) using the --list-extensions command.
This is not only true for Topgrade, but also any tool handling the extensions using this interface, even VSCode itself, because it means that it can list an extension and not be able to install it later.

However, if you really think this is impractical, other ways would be possible of course:

  • Re-open the upgrade all extensions issue (but this left the command code --list-extensions somewhat incomplete)
  • Add a cli feature to know what version of an extension is present in the marketplace (something like code --marketplace-version [ext0] [ext1] ... [extN] with same output format as code --list-extensions --show-versions when extension is present, and something to be defined when not)
  • Add the feature code --list-extensions --marketplace to list only extensions present in the marketplace

Hope this explanation clarify the needs behind that feature.

@sandy081
Copy link
Member

Thanks for the explanation and it gives me the context. For your usecase I recommend to a update-extensions command. I have reopened the issue and I would accept PR for that (as you can see help-wanted is already added to that issue).

IMO giving pre-release information in the extensions list output is necessary. Source (Marketplace / VSIX) information seems to be internal and I am happy to expose it if there is a proper usecase.

Therefore, I would stick this issue to expose only pre-release information. If needed, please file a separate issue for source information with valid usecase.

@vscodenpa
Copy link

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
@sandy081 sandy081 added *out-of-scope Posted issue is not in scope of VS Code and removed *out-of-scope Posted issue is not in scope of VS Code labels Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
6 participants