-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add [WingetVersion] Badge #10245
base: master
Are you sure you want to change the base?
add [WingetVersion] Badge #10245
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for having a look at this one
const version = latest(versions) | ||
|
||
return renderVersionBadge({ version }) | ||
} catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we expecting to catch a particular exception here?
If not, can we ditch the try/catch. Sentry will handle capturing the details of any unexpected runtime error for us in production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I forgot to remove debug code.
const entries = json.data.repository.object.entries | ||
const directories = entries.filter(file => file.type === 'tree') | ||
const versions = directories.map(file => file.name) | ||
const version = latest(versions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we could find out what the registry considers the "latest" version of a package? Do we have any info on how WinGet sorts versions?
I'm a bit worried that there doesn't really seem to be any constraint on what a version "number" can be. Here's some examples that have one or more odd ones:
- https://github.com/microsoft/winget-pkgs/tree/c939ca136ff33f217db1de99f1a1839790287a16/manifests/j/JetBrains/MPS/EAP
- https://github.com/microsoft/winget-pkgs/tree/c939ca136ff33f217db1de99f1a1839790287a16/manifests/n/niconico/nair/live
- https://github.com/microsoft/winget-pkgs/tree/c939ca136ff33f217db1de99f1a1839790287a16/manifests/j/Jigsaw/OutlineManager
- https://github.com/microsoft/winget-pkgs/tree/c939ca136ff33f217db1de99f1a1839790287a16/manifests/w/Wildy/bobonslaught
- https://github.com/microsoft/winget-pkgs/tree/c939ca136ff33f217db1de99f1a1839790287a16/manifests/t/taers232c/GAMADV-XTD3
Given it seems a version number can be basically any string, it seems like this we are going to get this wrong in some cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late response. I will investigate the update process in winget database
.required(), | ||
}).required(), | ||
}).required(), | ||
}).required() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #5548
Writing test in progress (might be tomorrow in JST)I wrote testsThis implementation fetches version information from https://github.com/microsoft/winget-pkgs/ with graphql api.
However, actual vrc-get command line interface retrieves package information from sqlite database file in https://cdn.winget.microsoft.com/cache/source.msix.
I don't know if this difference is acceptable for shelds.