Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 [snapcraft] version badge #9976
Add [snapcraft] version badge #9976
Changes from 6 commits
8e15ffe
cfddb22
062608c
e2f1e99
600ef27
f8206d5
992569b
3978c71
f1513ee
758428e
cce1946
8361fec
9ddcf16
2c4e2c4
75f8ac7
b54f1e6
29dd792
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.. one more question
You said in the top post
Can you expand on that. Can we actually rely on array position 0 to be the latest version?
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.
Snapstore allows devs to have more then one version channel, for example stable/beta/edge
They also seem to allow freedom when adding channel names.
Some snaps don't have stable channel, in those cases i found beta first or other channel.
I tested out a bunch of snaps and learned that:
The docs indicate here that:
IMO its safe enough to assume the first channel has the most "mainstream" version, but i can not guarantee it won't fail.
I think we should not limit it to the stable/latest channel as some packages don't have it.
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.
OK. Thanks for explaining that.
Although just picking the first one in the list means we will definitely put some value on the badge, I think it is maybe more important to focus on making sure it is clear and explainable what the value is.
I've had a bit of a look into this myself.
Lets take an example like chromium that has multiple channels and architectures
curl "https://api.snapcraft.io/v2/snaps/info/chromium" --header "Snap-Device-Series: 16"
Response
the way this gets expressed through the command line is
It seems to me like "channel" is really
track
andrisk
seperated by a slash.Another decision we could make here is we say the route is
/snapcraft/v/:package/:track/:risk
e.g:/snapcraft/v/chromium/latest/stable
or/snapcraft/v/chromium/latest/edge
. Then it is totally clear and unambiguous what we are showing. I don't think it should be too onerous for the publisher of the package to supply those extra params. That's primarily who we're envisaging will be constructing the URL.The other thing here is that for a given channel there may be multiple architectures in play. I think here we could take a cue from what we do with the docker version badge and take an optional
?arch
query param, which defaults toamd64
.Some other snap packages you might find useful for testing are:
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.
+1 on adding track and risk as path params, also adding arch as a query param seems natural.
I made those changes in the latest commits:
9ddcf16
2c4e2c4