-
-
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 sort and prerelease query params to [GitHubCommitsSince] (also refactors [GitHubRelease], [GitHubTag]) #4395
add sort and prerelease query params to [GitHubCommitsSince] (also refactors [GitHubRelease], [GitHubTag]) #4395
Conversation
Thanks for the PR @agilgur5!
That's correct, the There's other jobs that will run all of the unit tests, including those defined in I've updated the PR title accordingly and everything looks green now 👍 |
Thanks for the super-fast response @calebcartwright !! 😮
Ah I see, gotcha. I read the |
Fortunate timing 😄 CI looks good and the review app is up at https://shields-staging-pr-4395.herokuapp.com/ if you'd like to poke around. I'm signing out for the night but this'll get a more thorough review from a maintainer soon. Thanks again! |
Thanks for the contribution @agilgur5! Will aim at reviewing it over the week-end if no one picks it up before. 😉 |
- so that the sorting and prerelease logic can be used for other services too, like commits-since
049f0ec
to
02324d3
Compare
- they only work when using the 'latest' version of course - uses same logic as release service
- as they were the exact same schema
- and the same variable everywhere
02324d3
to
6f32ae4
Compare
…cts [GitHubCommitsSince], [GitHubRelease], [GitHubTag]) - this logic is only used for code related to releases & tags, so made sense as a split point
Thanks @agilgur5! Will try to take a final look at this one within the next couple days |
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.
LGTM! Thanks again for this, apologies for the late review
Description
Uses the new query params logic from the GitHubRelease Service to provide the same functionality for the GitHubCommitsSince Service when using the
latest
release (so one can use e.g.latest.json?sort=semver
).Motivation
I have some libraries where I have a commits since badge meant to track number of commits since the "latest" release. Since "latest" by GitHub API is by date, this means if I release a backport, the badge will start tracking from that backport since it's latest by date. Tracking commits since latest by semver is what I would like to do.
The workaround I've been having to do without this is to put the latest SemVer version into the badge and updating it whenever I make a new release (tedious, and has to already be pinned before any backport is released, otherwise above bug will occur until the badge is pinned, and if, say it's released on NPM before the badge is pinned, it will be tracking the backport until another release is added)
Related
Related to #1955 ; upon second read, I realized that asks for the addition of tags on top of just releases, what I was looking for in #1955 (comment) is actually different -- the addition of SemVer. Guess I read that wrong when I made that comment and never filed a separate issue for SemVer support.
Review Notes
Some things to look at in particular:
github-release.spec.js
togh.l7l.us.kgmon-fetch.spec.js
because I moved the logic there so it could be shared.getLatestRelease
isn't normally exposed, so I exported it as_getLatestRelease
so that the tests could import it. Not sure what the optimal/preferred way would be to do this (other than rewriting the tests to run against the newfetchLatestRelease
).gh.l7l.us.kgmon-fetch.spec.js
as it itself is not a service. It's currently causing CI to error because it's not found 😕Potential Future Opportunities
In addition to
latest
, could extending tracking for specific SemVer line -- e.g.^1.0.0
would track latest1.x.x
releases. This seems far from trivial (and unsure of efficiency on GitHub API), but it would allow say, a backport branch to show how many commits since the latest backport, instead of latest by SemVer or latest by date. Could also be used to track a certain SemVer line of dependencies or something