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

Filter out pre-release versions #18

Closed
anilanar opened this issue May 3, 2023 · 6 comments · Fixed by #21
Closed

Filter out pre-release versions #18

anilanar opened this issue May 3, 2023 · 6 comments · Fixed by #21

Comments

@anilanar
Copy link

anilanar commented May 3, 2023

Biggest pain for us right now is the gitlens extension, which we have to update every other day because nix-vscode-extensions points to a pre-release version and new pre-release versions require updating the extension otherwise the extension gets deactivated.

I wonder if the API that is crawled has more information about stable vs. pre-release versions.

@anilanar
Copy link
Author

anilanar commented May 3, 2023

Versions have the following property in properties array, but versions array contains only the latest version.

{
     "key": "Microsoft.VisualStudio.Code.PreRelease",
     "value": "true"
}

Maybe there's a way to apply a filter in the POST request.

@anilanar
Copy link
Author

anilanar commented May 3, 2023

I confirm that stable versions don't contain PreRelease key in properties. Example from gitlens:

{
                         "version": "13.5.0",
                         "flags": "validated",
                         "lastUpdated": "2023-04-07T17:41:21.193Z",
                         "files": [
                             {
                                 "assetType": "Microsoft.VisualStudio.Code.Manifest",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Code.Manifest"
                             },
                             {
                                 "assetType": "Microsoft.VisualStudio.Services.Content.Changelog",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Services.Content.Changelog"
                             },
                             {
                                 "assetType": "Microsoft.VisualStudio.Services.Content.Details",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Services.Content.Details"
                             },
                             {
                                 "assetType": "Microsoft.VisualStudio.Services.Content.License",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Services.Content.License"
                             },
                             {
                                 "assetType": "Microsoft.VisualStudio.Services.Icons.Default",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Services.Icons.Default"
                             },
                             {
                                 "assetType": "Microsoft.VisualStudio.Services.Icons.Small",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Services.Icons.Small"
                             },
                             {
                                 "assetType": "Microsoft.VisualStudio.Services.VsixManifest",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Services.VsixManifest"
                             },
                             {
                                 "assetType": "Microsoft.VisualStudio.Services.VSIXPackage",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Services.VSIXPackage"
                             },
                             {
                                 "assetType": "Microsoft.VisualStudio.Services.VsixSignature",
                                 "source": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612/Microsoft.VisualStudio.Services.VsixSignature"
                             }
                         ],
                         "properties": [
                             {
                                 "key": "Microsoft.VisualStudio.Services.Branding.Color",
                                 "value": "#8647ae"
                             },
                             {
                                 "key": "Microsoft.VisualStudio.Services.Branding.Theme",
                                 "value": "dark"
                             },
                             {
                                 "key": "Microsoft.VisualStudio.Services.Links.Getstarted",
                                 "value": "https://github.com/gitkraken/vscode-gitlens.git"
                             },
                             {
                                 "key": "Microsoft.VisualStudio.Services.Links.Support",
                                 "value": "https://github.com/gitkraken/vscode-gitlens/issues"
                             },
                             {
                                 "key": "Microsoft.VisualStudio.Services.Links.Learn",
                                 "value": "https://gitkraken.com/gitlens"
                             },
                             {
                                 "key": "Microsoft.VisualStudio.Services.Links.Source",
                                 "value": "https://github.com/gitkraken/vscode-gitlens.git"
                             },
                             {
                                 "key": "Microsoft.VisualStudio.Services.Links.GitHub",
                                 "value": "https://github.com/gitkraken/vscode-gitlens.git"
                             },
                             {
                                 "key": "Microsoft.VisualStudio.Code.Engine",
                                 "value": "^1.72.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"
                             },
                             {
                                 "key": "Microsoft.VisualStudio.Services.Content.Pricing",
                                 "value": "Free"
                             }
                         ],
                         "assetUri": "https://eamodio.gallerycdn.vsassets.io/extensions/eamodio/gitlens/13.5.0/1680889071612",
                         "fallbackAssetUri": "https://eamodio.gallery.vsassets.io/_apis/public/gallery/publisher/eamodio/extension/gitlens/13.5.0/assetbyname"
                     },

Latest version that doesn't contain { "key": "Microsoft.VisualStudio.Code.PreRelease", "value": "true" }, if cannot be found, then the latest version would do it.

What do you think?

@AmeerTaweel
Copy link
Collaborator

What you said makes sense. I don't have much time to work on this repo now because we're approaching the end of the semester in my university. I can work on it in the summer if no one else does.

@twz123
Copy link

twz123 commented May 11, 2023

Side note to this: The Marketplace API also reports the minimum required VSCode version (somewhere 👼, maybe in "Microsoft.VisualStudio.Code.Engine"?). It happened to me quite a few times that I updated to the latest extension versions, just to realize that they're not compatible to the (too old) VSCode version I was using. Would be awesome if it'd be possible to select the latest extension version based on the VSCode version in use.

@deemp
Copy link
Collaborator

deemp commented May 21, 2023

@twz123 , I'll add the information about the required minimal engine version into cache. Then, it'll be possible to filter out the extensions that require a version of VSCode that's greater than a specified one.

@deemp
Copy link
Collaborator

deemp commented May 21, 2023

This query gave me all versions of gitlens. I got this query after playing with flags. However, I could not make the API return the latest non-PreRelease version.

cat <<'EOF' | curl -sSL -H 'Accept: application/json;api-version=6.1-preview.1' -H 'Content-Type: application/json' https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery? -d @- > eamodio-gitlens.json
{
    "assetTypes": [],
    "filters": [
        {
            "criteria": [
                {
                    "filterType": 8,
                    "value": "Microsoft.VisualStudio.Code"
                },
                {
                    "filterType": 7,
                    "value": "eamodio.gitlens"
                }
            ],
            "pageNumber": 1,
            "pageSize": 2
        }
    ],
    "flags": 1073
}
EOF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants