Use api to get the latest tag ahead count #3197
Closed
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.
Fixes #2927
@fregante would love your input.
A bit of history of what i thought of doing.
First attempt was to get all the tag release dates in the original call. But github (as usual) does not give it 100% of the time.
So the next thing I did was if there was no date get it from the dom.
But then I realized that you can have commit dates not in order. (Very common by bootstrap on a rebase and merge).
So then I went with the following.
Try to get the ahead count from the dom. If the dom does not have it, take the release date from the dom and get the aheadcount from the API. With the issue of commit dates not in order, we should not be that off.
One issue, if the tag was created locally together with a commit the count will be ahead by one since they both happened the same time. I could fix it, not sure if its worth it.
Let me know what you think.
Test On https://github.com/fregante/delegate-it