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

Implement target platform #406

Merged
merged 1 commit into from
Apr 4, 2022
Merged

Conversation

amvanbaren
Copy link
Contributor

Fixes #336

CLI:

  • Add --target flag for publish and get commands.

web UI:

  • Add 'works with' section and download dropdown to extension detail page.
  • Admin: remove extensions by version and target platform.

server:

  • Change data model.
  • Update VSCodeAdapter.
  • Change other API endpoints to work with target platform, without breaking existing endpoints.
  • Add target platforms to search.

@amvanbaren
Copy link
Contributor Author

@benoitf Can you review/test whether the DatabaseSearchService still works as expected?

@benoitf
Copy link
Member

benoitf commented Jan 24, 2022

Hello @amvanbaren

I tried by grabbing vsix files from https://marketplace.visualstudio.com/items?itemName=joaomoreno.vscode-platform-specific-sample for different arch like darwin_x64 and darwin_arm64

Then published them with

cli/lib/ovsx publish joaomoreno.vscode-platform-specific-sample-....

Then searching the file for platform 'darwin_x64' I got

java.lang.IllegalStateException: Duplicate key 22 (attempted merging values org.eclipse.openvsx.dto.ExtensionDTO@4141f01d and org.eclipse.openvsx.dto.ExtensionDTO@783ec3a6)
        at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:133) ~[na:na]
        at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:180) ~[na:na]
        at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[na:na]
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
        at org.eclipse.openvsx.adapter.VSCodeAdapter.extensionQuery(VSCodeAdapter.java:151) ~[main/:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]

which is

                var extensionsMap = repositories.findAllActiveExtensionDTOs(ids).stream()
                        .collect(Collectors.toMap(e -> e.getId(), e -> e));

@akosyakov
Copy link
Member

@amvanbaren It would be nice if you specify how to test and to what pay attention. I will encourage team members from Gitpod to provide reviews but they need some pointers. It is generally is a good practice to document testing steps though.

@amvanbaren
Copy link
Contributor Author

@amvanbaren It would be nice if you specify how to test and to what pay attention. I will encourage team members from Gitpod to provide reviews but they need some pointers. It is generally is a good practice to document testing steps though.

Fair point, especially for this PR.

cli

  • publish an already packaged target specific vsix
  • publish and package a target specific vsix using --target and --packagePath options
  • get a vsix with and without --target option
  • get vsix metadata with --metadata option and with and without --target option

webui

  • extension detail page: does it show 'works with' section and download dropdown?
  • admin statistics report: does it return the same values as before? Generate a report on the
  • admin remove extension:
    • remove an extension version for a specific target platform
    • remove an extension version (all target platforms)
    • remove an extension version for a specific target platform and remove another extension version
    • remove all extension versions

server

  • Does DB migration run as expected?

  • VSCodeAdapter:

    • does VSCodium work as expected for target platform specific extensions?
    • does VSCodium work as expected for regular/universal extensions?
  • RegistryAPI:
    do existing endpoints still work as expected in theia or gitpod?

    • /api/{namespace}/{extension}
    • /api/{namespace}/{extension}/{version}
    • /api/{namespace}/{extension}/{version}/file/{fileName:.+}
    • /api/-/search
    • /api/-/query

    do new endpoints also work?

    • /api/{namespace}/{extension}/{target}
    • /api/{namespace}/{extension}/{target}/{version}
    • /api/{namespace}/{extension}/{target}/{version}/file/{fileName:.+}

other

  • UpstreamRegistryService
  • SitemapController: are sitemap entries generated for all target platforms?

@benoitf
Copy link
Member

benoitf commented Feb 7, 2022

Hello @amvanbaren

if I publish an extension using a specific target like the one from https://marketplace.visualstudio.com/items?itemName=joaomoreno.vscode-platform-specific-sample for darwin_x64, then I publish it

When searching for extension like sample I don't have any result

curl -v 'http://localhost:8080/vscode/gallery/extensionquery' -H 'Content-Type: application/json' --data-raw '{"filters":[{"criteria":[{"filterType":10,"value":"vscode-platform-specific-sample"},{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":950}'

while if I search on the marketplace (just replacing the endpoint), I have response

curl -v 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' -H 'Content-Type: application/json' --data-raw '{"filters":[{"criteria":[{"filterType":10,"value":"vscode-platform-specific-sample"},{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":950}'

(I tested using elasticsearch or database search)

@amvanbaren
Copy link
Contributor Author

@benoitf I've updated the PR. Search endpoints no longer assume the default target platform, but instead include all target platforms.

@jeanp413
Copy link
Contributor

@filiptronicek and me will take a look at this on Thursday

@amvanbaren amvanbaren force-pushed the feature/issue-336 branch 2 times, most recently from 0ee1e47 to f1462b9 Compare February 16, 2022 16:37
Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

We tried publishing joaomoreno.vscode-platform-specific-sample, specifically three different platform-specific types of one version. After we published it, in the WebUI we just get an Extension not found page upon visiting it (it is listed on the home page).

Using the query for the non-vscode endpoint returns the correct response (or it seems like it 😄): it responds with three different extensions (MS Marketplace only responds with one extension, an array for each version which contains the platforms).

curl http://localhost:8080/api/-/query -H 'accept: application/json' -H 'content-type: application/json' -d '{ "extensionId": "joaomoreno.vscode-platform-specific-sample" }' | jq .

But when VS Code tries to fetch it, there is an error (org.jooq.exception.TooManyRowsException: Cursor returned more than one result). You can reproduce that with the following curl command:

curl http://localhost:8080/vscode/gallery/extensionquery -H 'accept: application/json;api-version=3.0-preview.1' -H 'content-type: application/json' -d '{"filters":[{"criteria":[{"filterType":7,"value":"joaomoreno.vscode-platform-specific-sample"},{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":1,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":950}' | jq .

A successful response from Microsoft Marketplace should look like this

Disclaimer: it's long 😄
{
	"results": [
		{
			"extensions": [
				{
					"publisher": {
						"publisherId": "49e3db42-49c1-4e8f-9e0b-c7577efa9feb",
						"publisherName": "joaomoreno",
						"displayName": "João Moreno",
						"flags": "verified",
						"domain": null,
						"isDomainVerified": false
					},
					"extensionId": "4fc4f990-1b34-4ee1-a016-17405bbc4c40",
					"extensionName": "vscode-platform-specific-sample",
					"displayName": "Platform Specific Sample",
					"flags": "validated, public",
					"lastUpdated": "2021-09-10T09:35:45.573Z",
					"publishedDate": "2021-07-20T20:56:12.027Z",
					"releaseDate": "2021-07-20T20:56:12.027Z",
					"shortDescription": "VS Code platform specific extension sample",
					"versions": [
						{
							"version": "1.15.0",
							"targetPlatform": "linux-armhf",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:35:45.57Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266270314/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266270314/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266270314/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266270314/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266270314/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266270314",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.15.0",
							"targetPlatform": "win32-ia32",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:35:36.383Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266273792/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266273792/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266273792/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266273792/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266273792/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266273792",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.15.0",
							"targetPlatform": "darwin-arm64",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:33:43.273Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266272772/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266272772/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266272772/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266272772/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266272772/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266272772",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.15.0",
							"targetPlatform": "win32-x64",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:33:41.317Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266271584/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266271584/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266271584/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266271584/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266271584/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266271584",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.15.0",
							"targetPlatform": "darwin-x64",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:33:39.727Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266269426/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266269426/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266269426/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266269426/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266269426/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266269426",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.15.0",
							"targetPlatform": "win32-arm64",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:33:38.72Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266268694/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266268694/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266268694/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266268694/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266268694/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266268694",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.15.0",
							"targetPlatform": "alpine-x64",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:33:38.207Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266275159/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266275159/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266275159/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266275159/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266275159/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266275159",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.15.0",
							"targetPlatform": "linux-arm64",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:33:35.92Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266266517/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266266517/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266266517/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266266517/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266266517/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266266517",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.15.0",
							"targetPlatform": "linux-x64",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:33:25.437Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266267773/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266267773/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266267773/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266267773/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266267773/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266267773",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.15.0/assetbyname"
						},
						{
							"version": "1.14.0",
							"targetPlatform": "web",
							"flags": "validated",
							"lastUpdated": "2021-09-10T09:31:22.743Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.14.0/1631266136274/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.14.0/1631266136274/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.License",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.14.0/1631266136274/Microsoft.VisualStudio.Services.Content.License"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.14.0/1631266136274/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.14.0/1631266136274/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Support",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample/issues"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Learn",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample#readme"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/microsoft/vscode-platform-specific-sample.git"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace,web"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.14.0/1631266136274",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.14.0/assetbyname"
						},
						{
							"version": "1.2.1",
							"flags": "validated",
							"lastUpdated": "2021-07-21T12:42:06.64Z",
							"files": [
								{
									"assetType": "Microsoft.VisualStudio.Code.Manifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.2.1/1626871153799/Microsoft.VisualStudio.Code.Manifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.Content.Details",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.2.1/1626871153799/Microsoft.VisualStudio.Services.Content.Details"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VsixManifest",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.2.1/1626871153799/Microsoft.VisualStudio.Services.VsixManifest"
								},
								{
									"assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
									"source": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.2.1/1626871153799/Microsoft.VisualStudio.Services.VSIXPackage"
								}
							],
							"properties": [
								{
									"key": "Microsoft.VisualStudio.Services.Links.Getstarted",
									"value": "https://github.com/joaomoreno/vscode-platform-specific-sample"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.Source",
									"value": "https://github.com/joaomoreno/vscode-platform-specific-sample"
								},
								{
									"key": "Microsoft.VisualStudio.Services.Links.GitHub",
									"value": "https://github.com/joaomoreno/vscode-platform-specific-sample"
								},
								{
									"key": "Microsoft.VisualStudio.Code.Engine",
									"value": "^1.58.0"
								},
								{
									"key": "Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown",
									"value": "true"
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionDependencies",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionPack",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.LocalizedLanguages",
									"value": ""
								},
								{
									"key": "Microsoft.VisualStudio.Code.ExtensionKind",
									"value": "workspace"
								}
							],
							"assetUri": "https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.2.1/1626871153799",
							"fallbackAssetUri": "https://joaomoreno.gallery.vsassets.io/_apis/public/gallery/publisher/joaomoreno/extension/vscode-platform-specific-sample/1.2.1/assetbyname"
						}
					],
					"categories": [
						"Other"
					],
					"tags": [
						"__web_extension"
					],
					"statistics": [
						{
							"statisticName": "install",
							"value": 91.0
						},
						{
							"statisticName": "trendingdaily",
							"value": 0.0
						},
						{
							"statisticName": "trendingmonthly",
							"value": 0.0
						},
						{
							"statisticName": "trendingweekly",
							"value": 0.0
						},
						{
							"statisticName": "updateCount",
							"value": 23.0
						},
						{
							"statisticName": "weightedRating",
							"value": 4.4032047293092722
						},
						{
							"statisticName": "downloadCount",
							"value": 48.0
						}
					],
					"deploymentType": 0
				}
			],
			"pagingToken": null,
			"resultMetadata": [
				{
					"metadataType": "ResultCount",
					"metadataItems": [
						{
							"name": "TotalCount",
							"count": 1
						}
					]
				}
			]
		}
	]
}

@amvanbaren
Copy link
Contributor Author

MS Marketplace only responds with one extension, an array for each version which contains the platforms.

@filiptronicek Which MS Marketplace endpoint do you refer to?

@jeanp413
Copy link
Contributor

@amvanbaren

curl https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery -H 'accept: application/json;api-version=3.0-preview.1' -H 'content-type: application/json' -d '{"filters":[{"criteria":[{"filterType":7,"value":"joaomoreno.vscode-platform-specific-sample"},{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":1,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":950}' | jq .

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

We just tested the PR and there are a couple of things to note:

  1. In the web UI you can see the extension without errors
  2. The extension request in VS Code succeeds, but it also tries to fetch the extension manifest and that does not succeed, which means the extension refuses to install.
curl 'http://localhost:8080/vscode/asset/joaomoreno/vscode-platform-specific-sample/darwin-arm64/1.15.0/Microsoft.VisualStudio.Code.Manifest?targetPlatform=darwin-arm64' --HEAD

After that, VS Code tries querying this URL with the parameter of the platform: (it returns the README in markdown), but this argument is only added for platform-specific extensions.

https://joaomoreno.gallerycdn.vsassets.io/extensions/joaomoreno/vscode-platform-specific-sample/1.15.0/1631266267773/Microsoft.VisualStudio.Services.Content.Details?targetPlatform=linux-x64

Also note that there is also a target platform just named "web".

@amvanbaren
Copy link
Contributor Author

amvanbaren commented Feb 25, 2022

@filiptronicek I've changed the assetUri to not include the target platform as a path parameter.
http://localhost:8080/vscode/asset/joaomoreno/vscode-platform-specific-sample/1.15.0/Microsoft.VisualStudio.Code.Manifest?targetPlatform=darwin-arm64

The web target platform is excluded from the download links.
If there are no download links, then the download button is not shown in the webui.
This will mainly happen when an extension version only supports the web target.

I've rebased the branch to integrate pre-release functionality.

@filiptronicek
Copy link
Member

I just tried again and it looks like it will install and do compatibility checks just fine, including the download buttons! We will take a deeper look with @jeanp413 later, thanks for the quick fix, @amvanbaren!

@jeanp413
Copy link
Contributor

jeanp413 commented Feb 25, 2022

Well check here what we tested sucessfully:

cli

  • publish an already packaged target specific vsix
  • publish and package a target specific vsix using --target and --packagePath options
  • get a vsix with and without --target option
  • get vsix metadata with --metadata option and with and without --target option

webui

  • extension detail page: does it show 'works with' section and download dropdown?
  • admin statistics report: does it return the same values as before? Generate a report on the

admin remove extension:

  • remove an extension version for a specific target platform
  • remove an extension version (all target platforms)
  • remove an extension version for a specific target platform and remove another extension version
  • remove all extension versions

server

  • Does DB migration run as expected?

VSCodeAdapter:

  • does VSCode work as expected for target platform specific extensions?
  • does VSCode work as expected for regular/universal extensions?

RegistryAPI:

do existing endpoints still work as expected in theia or gitpod?

  • /api/{namespace}/{extension}
  • /api/{namespace}/{extension}/{version}
  • /api/{namespace}/{extension}/{version}/file/{fileName:.+}
  • /api/-/search
  • /api/-/query

do new endpoints also work?

  • /api/{namespace}/{extension}/{target}
  • /api/{namespace}/{extension}/{target}/{version}
  • /api/{namespace}/{extension}/{target}/{version}/file/{fileName:.+}

other

  • UpstreamRegistryService
  • SitemapController: are sitemap entries generated for all target platforms?

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Today we looked over this again and made a checklist for tracking progress with what we tested.

We found that when you publish an extension as a platform specific one and then in the next version of it you publish it as universal (no target flag), you cannot go back to the page containing the previous version, only a blank screen. After that, we published a bumped Linux only version (linux-x64) and that version got published, put in the database but did not show in the UI (or in the API, meaning it would be good to always show latest version it doesn't matter if there is only one arm64 package, always show latest, but when querying for a specific platform, show latest compatible). Then we published the same version as universal and now we have it available on the web UI.

After all of this we tried downloading a vsix from an extension without the --target flag, but although it has an Universal version, it did not return anything 😕.

/workspace/openvsx/cli/lib/ovsx get joaomoreno.vscode-platform-specific-sample -v 1.15.0 -o /workspace/

Produces ❌ Invalid Version: latest

A nitpick: the downloaded names for packages from the previous command have a different naming convention than the Microsoft ones: maybe it would be good to change it to {id}-{version}@{platform}.vsix

@jeanp413
Copy link
Contributor

jeanp413 commented Feb 25, 2022

@amvanbaren

  • What command should we use to remove an extension specific version, all versions etc?
  • How do we test Does DB migration run as expected?
  • How do we get admin statistics report?

@amvanbaren
Copy link
Contributor Author

What command should we use to remove an extension specific version, all versions etc?

Extensions can be removed in the webui admin dashboard.
You have to configure Github login, run the server and login with your Github account, then update your user's role to admin in the database. Now you have access to the admin dashboard.
Unless you've already setup Github login, it's probably easier to test this on staging. I'll test this locally today after I've implemented the required changes, so that we can be fairly certain it'll work on staging too.

How do we test Does DB migration run as expected?

This can be tested when the server is deployed to staging.
Then we can check that existing extensions are correctly migrated.

How do we get admin statistics report?

By getting /admin/report?token=super_token&year=2022&month=1
The token has to link to a admin user, that's why super_token is used.

@amvanbaren
Copy link
Contributor Author

amvanbaren commented Feb 28, 2022

My TODO list:

  • If no target platform is specified, then find latest extension version across all of the extension's target platforms.
  • CLI get command should return universal version when --target flag isn't specified.
  • CLI get command fix ❌ Invalid Version: latest
  • Use @ as separator between version and target platform in file names.
  • Locally test delete extension in admin dashboard.
  • Locally test db migration.

@filiptronicek
Copy link
Member

Let's review again tomorrow, @jeanp413?

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

We reviewed again today and found the following:

  • downloading works but the file is not URL-decoded, which means it is not id-version@target, but id-version%40target
  • the ovsx get command always downloads the latest published target file, which means when we publish a Linux package and then macOS and then download it with the get command, we get the macOS version. We figured with @jeanp413 that it should always default to downloading universal and if it is not there and no --target is specified it should error out.
    • this is probably also tied into the bug where if you query with ovsx get --metadata extension.id it puts darwin-arm64 as the tagetPlatform even though the download section has both linux-x64 as well as darwin-arm64 release assets.
  • also, this may not be a bug at all, but when publishing a universal version of an extension and then seeing its metadata via the cli, it returns its download link indexed by an empty string, which is something I haven't seen before 😄:
    "downloads": {
        "": "http://localhost:8080/api/joaomoreno/vscode-platform-specific-sample/1.15.0/file/joaomoreno.vscode-platform-specific-sample-1.15.0.vsix",
        "linux-x64": "http://localhost:8080/api/joaomoreno/vscode-platform-specific-sample/linux-x64/1.15.0/file/joaomoreno.vscode-platform-specific-sample-1.15.0%40linux-x64.vsix",
        "darwin-arm64": "http://localhost:8080/api/joaomoreno/vscode-platform-specific-sample/darwin-arm64/1.15.0/file/joaomoreno.vscode-platform-specific-sample-1.15.0%40darwin-arm64.vsix"
    }

In addition, could you (@amvanbaren) please instruct us how to see the reports in the admin dashboard? We always got a blank page with a 200-status code. Should we try to view it in the browser or curl it?

@amvanbaren
Copy link
Contributor Author

amvanbaren commented Mar 11, 2022

downloading works but the file is not URL-decoded, which means it is not id-version@target, but id-version%40target

Ok, I'll add URL decoding to the download file name in the get command.
Part of the problem is on the server side, because UrlEncoder is used to encode path segments and query parameters. PR #433 addresses this issue.

We figured with @jeanp413 that it should always default to downloading universal and if it is not there and no --target is specified it should error out

Ok, If --target isn't specified, then universal will be used as target

also, this may not be a bug at all, but when publishing a universal version of an extension and then seeing its metadata via the cli, it returns its download link indexed by an empty string, which is something I haven't seen before 😄

Yes, I decided to use an empty string as targetPlatform throughout the server for backward compatibility. I'll check if there's still a good reason to use an empty string, if not I'll change it to 'universal'.

In addition, could you (@amvanbaren) please instruct us how to see the reports in the admin dashboard? We always got a blank page with a 200-status code. Should we try to view it in the browser or curl it?

You can use curl to view the admin report:

curl --location --request GET 'http://localhost:8080/admin/report?token=super_token&year=2022&month=3'

TODO:

  • CLI get command: URL decode download file name
  • CLI get command: use 'universal' when --target parameter isn't supplied
  • server: Use 'universal' instead of empty string as default target platform

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the issues, @amvanbaren! I just took a look, here are my thoughts:

  • awesome that the ovsx get now defaults to the universal target, but I think the new error message style is a bit weirdly phrased:
❌  Extension not found: joaomoreno.vscode-platform-specific-sample for universal

I would suggest maybe something like

❌  Package not found: joaomoreno.vscode-platform-specific-sample ({platform})

Because the extension does exist, but no corresponding packaged asset exists for the selected platform. I would be ok though with this being as is.

💡 idea (non-blocking): @amvanbaren do you think it would make sense to respond to /api/{namespace}/{extension}/universal with a 301 Moved Permanently or 308 Permanent Redirect and redirect to /api/{namespace}/{extension}/? (But maybe this is a bad idea and would be inconsistent with MS, but could not find a way to look at this)

🐛 bug (blocking): in the web view, I found that the download links for extensions are malformed, this is one I just got for Apple Silicon:

http://localhost:3000/extension/joaomoreno/localhost:8080/api/joaomoreno/vscode-platform-specific-sample/linux-x64/1.15.0/file/joaomoreno.vscode-platform-specific-sample-1.15.0%40linux-x64.vsix

Note: this only happens with the download dropdown, if there is only one download link (platform independent) the link works fine.

I believe this is displayed here, but I'm not sure where exactly the link is created:

https://github.com/amvanbaren/openvsx/blob/a353532d9050e4a6695255600398e6db71435853/webui/src/pages/extension-detail/extension-detail-downloads-menu.tsx#L67

@amvanbaren
Copy link
Contributor Author

@filiptronicek

do you think it would make sense to respond to /api/{namespace}/{extension}/universal with a 301 Moved Permanently or 308 Permanent Redirect and redirect to /api/{namespace}/{extension}/?

The /api/{namespace}/{extension} endpoint returns the latest extension version regardless of target platform. It does try to get a universal version first but falls back to any other target platform in alphabetical order.
The /api/{namespace}/{extension}/{targetPlatform} endpoint returns the latest extension version for a specific target platform.
To be able to respond with a redirect additional logic needs to be added to ensure that /api/{namespace}/{extension}/universal and /api/{namespace}/{extension} point to the same ExtensionVersion.

An example:
A publisher publishes extension version 1.15.0 for all target platforms. Calling /api/{namespace}/{extension}/universal returns the same response as /api/{namespace}/{extension}.

The linux-x64 release of version 1.15.0 contains a couple bugs. The publisher publishes extension version 1.15.1 for linux-x64 to fix those bugs. Calling /api/{namespace}/{extension}/universal still returns version 1.15.0, while calling /api/{namespace}/{extension} returns version 1.15.1 (linux-x64).

I'll fix the other issues.

@amvanbaren
Copy link
Contributor Author

amvanbaren commented Mar 22, 2022

❌ Package not found: joaomoreno.vscode-platform-specific-sample ({platform})

The CLI calls the /api/{namespace}/{extension}/{target} endpoint to get extension metadata.
If this endpoint can't find the extension it now returns 'Extension not found: {namespace}.{extension} {version} ({target})'.
I don't think it is suitable to change 'Extension' to 'Package', because it is a general purpose endpoint.

cli/README.md Outdated
@@ -39,7 +39,7 @@ You can use `ovsx` for downloading extensions from an Open VSX instance. Extensi

Variants:
* `ovsx get <extension>`
downloads an extension and saves it in a file as specified in its download URL (usually in the format `namespace.extension-version.vsix`) in the current working directory.
downloads an extension and saves it in a file as specified in its download URL (usually in the format `namespace.extension-version@target.vsix`) in the current working directory.
Copy link
Member

Choose a reason for hiding this comment

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

Could we mention here that for most extension there will be no @target part? I know it will make the description quite a bit lengthier, but it is

  1. optional
  2. not used as much and could confuse some users. We can point to the VS Code docs about the feature [1]

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

This PR LGTM, just one small inconsistency with the MS Marketplace:
If you publish a stable version of for example win32-x64 and then a pre-release with another platform (e.g. linux-x64), the pre-release flag will be basically ignored. Could we perhaps add a warning in the console about this?

It is an inconsistency, but that does not mean I want to have it the way that MS has it 😄, as they just ignore that you ever published that pre-release and don't even treat it as a release, so you couldn't download the linux-x64 from the example I gave.

@amvanbaren
Copy link
Contributor Author

If you publish a stable version of for example win32-x64 and then a pre-release with another platform (e.g. linux-x64), the pre-release flag will be basically ignored. Could we perhaps add a warning in the console about this?

Is this when you publish 0.1.0 for win32-x64 and then 0.1.0 pre-release for linux-x64?
Or is it when you publish 0.1.0 for win32-x64 and then 0.2.0 pre-release for linux-x64?

Maybe we should add a constraint like this:

we recommend that extensions use major.EVEN_NUMBER.patch for release versions and major.ODD_NUMBER.patch for pre-release versions. For example: 0.2.* for release and 0.3.* for pre-release.

@filiptronicek
Copy link
Member

Is this when you publish 0.1.0 for win32-x64 and then 0.1.0 pre-release for linux-x64?
Or is it when you publish 0.1.0 for win32-x64 and then 0.2.0 pre-release for linux-x64?

@amvanbaren sorry for not mentioning that 🙏, it was the former - the versions were the same.

Maybe we should add a constraint like this:

I think although that would make sense and would eliminate the issue, there will be some extensions which break sooner or later. It would be ideal if all extensions did what Microsoft recommends, but if Microsoft doesn't disallow it, I think we shouldn't as well.

@amvanbaren
Copy link
Contributor Author

It would be ideal if all extensions did what Microsoft recommends, but if Microsoft doesn't disallow it, I think we shouldn't as well.

Ok, makes sense. Maybe a warning like this:
⚠️ A stable release | pre-release already exists for namespace.extension-version.
  To prevent update conflicts we recommend that this pre-release | stable release uses new_version as version instead.

In the console you would then see:
🚀 Published redhat.vscode-yaml v0.5.2@linux-x64
⚠️ A stable release already exists for redhat.vscode-yaml-0.5.2.
  To prevent update conflicts we recommend that this pre-release uses 0.6.0 as version instead.

cli/README.md Outdated Show resolved Hide resolved
Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Thank you, I reviewed the latest changes and they work flawlessly.

LGTM ✅

@felipecrs
Copy link
Contributor

felipecrs commented May 2, 2022

Just out of curiosity, would something like:

npx vsce publish --packagePath $(find . -iname *.vsix)

Work for ovsx, where the multiple *.vsix files would target different platforms?

This comes from https://github.com/microsoft/vscode-platform-specific-sample/blob/main/.github/workflows/ci.yml#L74.

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.

Add support for specific platforms
6 participants