-
-
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
[GitHubRelease] Get releases using semver (similar logic to tags) #3144
Conversation
|
For clarification, is |
And the updated |
GitHub API aside, I usually think of "latest" as meaning semver-latest. Instead of using |
I think It would definitely be useful to add a An additional complication is that our tag and release badges are inconsistent. Right now we've got: Releases
Tag
Its unfortunate that the base Finally, if we do go down the route of breaking BC on |
Just to quantify this with some stats from the excellent new services dashboard 📊 , over the last week |
Also we could update the tag endpoint to use the GraphQL API v4: |
Another option is to use a query param, like |
Well spotted :D
Yeah. Last time we played around with this, we did discuss
Another suggestion is we could define our consistent URL schema for tag and release badges (accounting for order by date, order by semver and include pre-release cases) as if we were starting with no legacy compatibility to deal with, start again (say at |
Here's a proposed guideline for determining whether to use a query param or a URL path component. A URL path component should be used for one of these things:
Query params should be used for these three things:
If there aren't objections to the guideline I could open a new PR to pull that into the docs. |
Agreed we shouldn't try hard to keep the existing logic working the same for all the users who are using it. 💯
I think that's a reasonable argument, though I'm not completely convinced. Both releases and tags on GitHub are often created out of order. I've often pushed tags to projects retroactively, and I've seen projects switch from Releases to just tags, and vice versa. Since GitHub is not an artifact repository, there is not an expectation that releases or tags are created at the time code is published. Nor can any expectations be made about a specific versioning-scheme.
If this helps here, I'd definitely support this. Shields is an "everything and the kitchen sink" sort of project and it's generally hard + rare that we remove features once they exist. So I think the best thing we can do to keep the mental overhead down and keeping Shields feeling easy to use is to aggressively simplify the interfaces, keep them consistent across services, and provide good defaults that generally shield users from complexity. Another thing that compounds confusion here is that GitHub uses "releases" in the UI to refer to tags that don't have corresponding releases. This is one of our most frequently asked questions. One possibility could be to deprecate
When Another option would be to put this all under
A couple other points to consider related to the query params:
|
This is mostly the opposite of what we're actually doing though:
It would be really good to have some docs around URL schema conventions to refer to when adding new services, also covering common naming conventions (e.g:
Both good suggestions.
I think GitHub is a bit special in this respect. GitLab and BitBucket would fall into the same category, but most of the platforms we support don't because mostly the conventions of the platform or language community defines how you should sort versions:
GitHub is a broad church though and hosts projects which use all of the conventions I've just mentioned and more. That's also why date is the only really safe default here IMO. |
Right. If we went in this direction it'd be a good handful of
Broadly agreed. The change I'm proposing (i.e.
One option would be for |
No I think it is sensible to make the GH tags/releases integration match the convention we want everything to use moving forwards and then bring the rest into line instead of putting these on temporary routes we plan to redirect from in the near future. It would be annoying if a very common badge needs a chain of 2 redirects to serve it (both for maintenance and performance). Also lets not boil the ocean all at once (we don't need to widen the scope of this PR to "change our entire URL schema") but its worth going through our existing routes and thinking about which ones we would want to change to bring into line with this convention before we adopt it. I'm going to suggest the following assumption here:
This seems reasonable, as long as we classify On that assumption, other than
I think I'd be inclined to try and avoid trying to be "clever" if sorting tags by date and just accept a tag is a tag, particularly if |
Don't we already have this feature in All else sounds good.
Huh. Moving branch to the query would simplify some of our routes – there's one pattern (github dependency version?) it would make less ambiguous. But there would be such a huge number of routes that would need changing. Our of curiosity, is that your thinking as well? |
No.
I think we'd be looking at adding something like ~70 redirects if |
Yea, agreed. 👍 It's worth remembering that we could move part of the route into a query param if we otherwise can't build the route unambiguously. I was just looking at GitHub downloads, which might be a candidate for that: either the tag or the path could move into the query param.
Ahh I gotcha. So |
Sounds like the decision is to tackle this after rewriting this badge for #2863. Ref #2863 (comment) |
Closes #3080
This PR updates the GitHub releases badge to use our
latestVersion
function instead of using the most recent release by date (similar to the tag badge).You can still get the latest release using
/release-latest/:user/:repo
(although this excludes pre-releases)