vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Adopt the pre-release extension feature

Open isidorn opened this issue 3 years ago • 10 comments

Prerequisites

  • [X] I have written a descriptive issue title.
  • [X] I have searched all issues to ensure it has not already been reported.

Summary

Refs: https://github.com/microsoft/vscode/issues/15756

VS Code now supports pre-release extensions. Docs that should help: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions

I know powershell has a separate powershell preview extension. Ideally we would deprecate that extension and you would publish pre-release versions. VS Code can migrate your users automatically once you do the adoption.

Let me know what you think.

fyi @TylerLeonhardt

Proposed Design

No response

isidorn avatar Dec 09 '21 12:12 isidorn

We've got this on our radar, but question for you @isidorn: I know VS Code now supports this, but isn't the marketplace still working on full support (especially around supporting extensions to publish with proper semantic versioning, with the necessary pre-release suffixes)? I looked and can't find the issue for the latter, but it's a long open one.

andyleejordan avatar Dec 09 '21 16:12 andyleejordan

@andschwa yes, MP is working on supporting full semver versioning. However since the MP is currently in the process of changing their backend infrastructure this will probably take some time. My very very rough estimate, end of 2022 at the earliest. Here's the issue on the MP side https://github.com/microsoft/vsmarketplace/issues/50

isidorn avatar Dec 10 '21 09:12 isidorn

Cool, thanks! I'll keep an eye on that and when this is fully supported we'd love to do it.

andyleejordan avatar Dec 10 '21 17:12 andyleejordan

@andschwa why is https://github.com/microsoft/vsmarketplace/issues/50 a blocker for us? At least since the updated CI and the CalVer versioning, we don't use any semver suffixes in the published packages, and we only use 3 octets so if you wanted to clearly distinguish Preview from stable, the fourth octet could be used e.g. 2022.02.0.4

JustinGrote avatar Feb 15 '22 14:02 JustinGrote

We use -preview suffix for the preview releases, and that's explicitly what marks them as newer (and not stable), and is what their implementation seems to require as well.

andyleejordan avatar Feb 15 '22 17:02 andyleejordan

@andschwa I'm confused image image

When publishing the vsix why can't you just either append an extra .0/.1 or remove the preview flag on the filename when publishing?

EDIT: Nevermind, reading https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions

Makes this difficult for calver, because newer versions will bump prerelease people to stable regardless, making it difficult to maintain two long-term tracks. Crappy implementation if you ask me, there should be an option to always stay on pre-release if it is tagged that way.

JustinGrote avatar Feb 15 '22 19:02 JustinGrote

@andschwa I did some more thinking on this, why not just append .1 as the forth octet to every preview release? Then just have to make sure a preview always goes out with the stable on releases (which they do today)

For instance:

2022.02.1.1 - Prerelease 2022.02.1 - Stable

2022.02.2.1 - Prerelease 2022.02.2 - Stable

2022.03.0.1 - Prerelease 2022.03.0 - Stable

etc.

JustinGrote avatar Feb 24 '22 21:02 JustinGrote

Unfortunately, I don't think npm likes that forth octet :( it's really annoying... any the marketplace doesn't support -blah

TylerLeonhardt avatar Feb 24 '22 22:02 TylerLeonhardt

@TylerLeonhardt right, just trying to think of a workaround for the prerelease tag.

JustinGrote avatar Feb 25 '22 00:02 JustinGrote

@SydneyhSmith Assigned to you for investigation!

andyleejordan avatar May 05 '22 19:05 andyleejordan

I'm pretty sure the versioning issue is sorted out since we no longer maintain two long separate tracks. We really have one extension, and the preview is just exactly that, an early preview of what's planned to go into the stable extension as long at isn't broken. So we don't need full SemVer support any more, and can just use our existing versions like 2023.3.0 with preview: true in the package.json (and --pre-release for vsce when packaging and publishing). Additionally it'll be absolutely fine that when we roll preview to stable (just by switching to preview: false) that preview users will get the stable installed...it will technically be the newest, and the docs say those users will get the next preview when we push it. So we're on our way to supporting this!

andyleejordan avatar Mar 15 '23 20:03 andyleejordan

Makes sense to me! Upon release you'll probably need to push one last preview extension that implements the deprecated field and points to the "main" extension.

JustinGrote avatar Mar 15 '23 20:03 JustinGrote

Awesome! Love seeing this ❤️

We have a mechanism in VS Code for transitioning existing users of "PowerShell Preview" to the new "PowerShell Pre-Release". Sydney and me are discussing to enable this.

isidorn avatar Mar 16 '23 10:03 isidorn

@JustinGrote I don't see any deprecated field in the extension manifest, but I believe that @isidorn and the VS Code team are handling this in the backend. Thanks very much all!

FYI @TylerLeonhardt I need to update the docs, but we actually need to keep preview: true in the manifest for our pre-release versions because it's the way we determine during packaging and releasing that we need to pass --pre-release to vsce. Since we have to drop the -preview suffix from the version, there doesn't seem to be any other good way to determine from the sources (well, unless we check the changelog but that's hairier) if it's a pre-release version. So, that's why the flag is staying!

andyleejordan avatar Mar 16 '23 19:03 andyleejordan

@JustinGrote I don't see any deprecated field in the extension manifest, but I believe that @isidorn and the VS Code team are handling this in the backend. Thanks very much all!

Oops you are right, this is a backend thing https://github.com/microsoft/vscode-discussions/discussions/1

JustinGrote avatar Mar 16 '23 19:03 JustinGrote

@andschwa could change the preview: false right before the publish in the build?

TylerLeonhardt avatar Mar 16 '23 21:03 TylerLeonhardt

I don't think so, it's embedded in the VSIX isn't it? So it's already been created and signed. It'd be a heck of a hack to unzip it, edit the package.json and rezip it (and that might break whatever the signing is) just to avoid a little "preview" banner.

andyleejordan avatar Mar 16 '23 23:03 andyleejordan

Oh do you unzip the VSIX in order to check the preview property of the manifest?

TylerLeonhardt avatar Mar 16 '23 23:03 TylerLeonhardt

No, I check it from the sources that exist next to it in the pipeline (from the ADO checkout step). But to change it "right before the publish" as you suggest would entail editing the VSIX, no? Since vsce takes a --package-path to the VSIX file?

Anyway, we do need to revisit it because it appears that the marketplace web page like here shows the assets from the most recent release (even if it was "pre-release") meaning that page shows the "preview" tag and the "preview" icon (which only exist in the pre-release version of the extension). Is this perhaps something that could be fixed upstream? I.e. code the marketplace webpage to display information from the most recent non-pre-release upload? The "version" and "last updated" on the side also are from the pre-release upload, not the stable one.

andyleejordan avatar Mar 17 '23 00:03 andyleejordan

No, I check it from the sources that exist next to it in the pipeline (from the ADO checkout step). But to change it "right before the publish" as you suggest would entail editing the VSIX, no? Since vsce takes a --package-path to the VSIX file?

In this case, maybe set it to false before packing the VSIX and then set it back to true... or just use an Azure DevOps pipeline variable that you could read later.

I'll defer to @isidorn for the Marketplace bug.

TylerLeonhardt avatar Mar 17 '23 00:03 TylerLeonhardt

I acknowledge this bug on the Marketplace side. For this to be fixed either Marketplace has to be aware of pre-release extensions or to introduce SemVer support. I do not think either will happen this year, but hopefully some time in 2024.

My suggestion - consider just removing the "preview" tag in both cases.

isidorn avatar Mar 17 '23 09:03 isidorn

All right, all right. I'll find another way to pass the pre-release info along from build to package to publish, and will temporarily stop changing the icon to the PowerShell Preview icon (but it's so cute).

andyleejordan avatar Mar 17 '23 16:03 andyleejordan