You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Link to "What changed since the previous release?" #966
Need some help from other developers? Add your repositories on Issuehunt to raise funds.
Reacted by Sindre Sorhus, Harry Dobrev, Jonas Gierer, Pierre Fenoll, Steven, Jesse Hodges, Nikolaos Kakouros, Scott Busche, Phoenix, Jeroen van Warmerdam and 4 more
changed the title [-]Link to "What's changed since the previous last release?"[/-][+]Link to "What changed since the previous release?"[/+]on Jan 11, 2018
I was able to fetch the details for "react" but the API returned 0 results for the "parcel". I also tried to fetch details for a single release by passing the tag name but the result was still the same. Is there something that I missed or it's a glitch on GitHub's end?
Update: I also tried the REST API and I'm not able to fetch the release details for "parcel".
Parcel only uses tags, not releases. This feature should only query releases
Also why are you querying two repos at the same time?
If it makes things easier (or cheaper) you probably only need to get the previous release related to the last one on the page (or the only one) since the other ones are already available.
Parcel only uses tags, not releases. This feature should only query releases
How can we differentiate whether it's the release or just a tag?
Also why are you querying two repos at the same time?
It was just an example.
If it makes things easier (or cheaper) you probably only need to get the previous release related to the last one on the page (or the only one) since the other ones are already available.
Definitely, That's the better approach. I was just trying out the GitHub GraphQL API for releases and encountered this behavior.
How can we differentiate whether it's the release or just a tag?
I think I found an answer. I found that for the tags class name is release-timeline-tags release-entry and for the releases, the class name is release-entry. Is it the way we are gonna differentiate?
@bfred-it We can achieve it without using the GraphQL API. We can load the next page in using include-fragment and extract the tag details from that. It would be much simpler, IMO. How about that? Another thing, I tried the API approach but I'm not able to accomplish it in a single API call. Is there any more efficient way to fetch the next tag?
One thing to keep in mind is, as seen on the parcel repo, they have multiple tags on the same commit, so "the previous tag" is not necessarily "the one below it".
Yes, I noticed this thing. We can compare the commit hash for the release/tag and if they are same, we can skip them or better we can show the compare link to the previous release which is having different commit hash.
If not too complex (and if this is standard many repos follow), there could be smart specific links like [email protected]@1.12.3 on parcel-bundler tags
@parcel/[email protected]...@parcel/[email protected] on @parcel/integration-tests tags.
If they are on the same page, we can show but if they are on different pages, it won't be easy. Not sure if there is a way to get the tags having the specific prefix.
e.g. @parcel/[email protected]. I tried the GitHub object with expression and refs but doesn't return what we want and we might have to call API multiple times to get the result we want.
Starting from as in, tag text starting with the particular prefix or tags after some particular tag?
Because I tried the API and I'm not able to filter the tag starting with the particular prefix.
Also, for pagination, there seems no way to say I want 5 tags only after "v1.10.1" or by ID. I'll have to fetch the tags first to get the cursor and then only I can navigate. back and forth.
Now the question is, How should we use this information and proceed?
Should we only use the API for namespaced tags? For the rest, we can rely on our basic approach as we have the tag details present on the page itself.
If we query API for tags of specific namespace then if namespaces are many then we'll have to fire multiple API requests.
If we query the latest 100 tags. We have the necessary information now to query the next batch. Now if we need we can query for another batch of 100 and continue. The number of API requests may increase as the number of tags.
1. Should we only use the API for namespaced tags? For the rest, we can rely on our basic approach as we have the tag details present on the page itself.
Forget namespaced tags for a moment, how do you plan to get "the previous tag" on a single tag page?
I will get the page in response which will contain pagination links. I can extract the link of the previous page and next page. From this link, I can get the previous/next tag.
It won't work for the last tag. and for the cases when the releases are only on a single page.
Brute force approach. If we have the list we can find the previous tag.
Do you have any other approaches in mind? @bfred-it
ignore the pagination in it, let's not add prev/next for now
if you want to add prefix-aware links (@parcel/integration-tests@***), only look in that page. If none are found, ignore the tag or just use the previous non-prefix-aware tag
If we really want to add a Next link we need to find a solution that does not require multiple consecutive fetches (whether it's the pagination link or the brute force). But for now we can ignore it
Activity
hkdobrev commentedon Jan 8, 2018
I think this is similar to that old discussion: #395 (comment)Scratch that, I meant a different discussion, but couldn't find it.👍
[-]Link to "What's changed since the previous last release?"[/-][+]Link to "What changed since the previous release?"[/+]sindresorhus commentedon Nov 7, 2018
We now use the API much more, so we can use the API for this feature too.
IssueHuntBot commentedon Apr 11, 2019
@IssueHunt has funded $80.00 to this issue.
hardikmodha commentedon Apr 27, 2019
@bfred-it I was going through the GitHub GraphQL API to fetch the release details. I ran the following query,
I was able to fetch the details for "react" but the API returned 0 results for the "parcel". I also tried to fetch details for a single release by passing the tag name but the result was still the same. Is there something that I missed or it's a glitch on GitHub's end?
Update: I also tried the REST API and I'm not able to fetch the release details for "parcel".
fregante commentedon Apr 27, 2019
Parcel only uses tags, not releases. This feature should only query releases
Also why are you querying two repos at the same time?
If it makes things easier (or cheaper) you probably only need to get the previous release related to the last one on the page (or the only one) since the other ones are already available.
hardikmodha commentedon Apr 27, 2019
How can we differentiate whether it's the release or just a tag?
It was just an example.
Definitely, That's the better approach. I was just trying out the GitHub GraphQL API for releases and encountered this behavior.
hardikmodha commentedon Apr 27, 2019
I think I found an answer. I found that for the tags class name is
release-timeline-tags release-entryand for the releases, the class name isrelease-entry. Is it the way we are gonna differentiate?fregante commentedon Apr 27, 2019
All releases have a tag and the URL isn't different. Just query the tag
hardikmodha commentedon Apr 27, 2019
@bfred-it We can achieve it without using the GraphQL API. We can load the next page in using
include-fragmentand extract the tag details from that. It would be much simpler, IMO. How about that? Another thing, I tried the API approach but I'm not able to accomplish it in a single API call. Is there any more efficient way to fetch the next tag?6 remaining items
hardikmodha commentedon Apr 28, 2019
Yes, I noticed this thing. We can compare the commit hash for the release/tag and if they are same, we can skip them or better we can show the compare link to the previous release which is having different commit hash.
hardikmodha commentedon Apr 28, 2019
If they are on the same page, we can show but if they are on different pages, it won't be easy. Not sure if there is a way to get the tags having the specific prefix.
e.g.
@parcel/[email protected]. I tried the GitHubobjectwithexpressionandrefsbut doesn't return what we want and we might have to call API multiple times to get the result we want.hardikmodha commentedon Apr 28, 2019
Maybe I can just fetch all the tags and perform filtering on the client side.
fregante commentedon Apr 28, 2019
Ideally you would get the last few tags starting from X and then filter them
hardikmodha commentedon Apr 28, 2019
Starting from as in, tag text starting with the particular prefix or tags after some particular tag?
Because I tried the API and I'm not able to filter the tag starting with the particular prefix.
Also, for pagination, there seems no way to say I want 5 tags only after "v1.10.1" or by ID. I'll have to fetch the tags first to get the
cursorand then only I can navigate. back and forth.hardikmodha commentedon Apr 28, 2019
Found an API https://developer.github.com/v3/git/refs/#example-matching-a-partial-branch-name. We can request tags of a particular namespace.
e.g.
and
Now the question is, How should we use this information and proceed?
Should we only use the API for namespaced tags? For the rest, we can rely on our basic approach as we have the tag details present on the page itself.
If we query API for tags of specific namespace then if namespaces are many then we'll have to fire multiple API requests.
If we query the latest 100 tags. We have the necessary information now to query the next batch. Now if we need we can query for another batch of 100 and continue. The number of API requests may increase as the number of tags.
What do you think @bfred-it?
fregante commentedon Apr 28, 2019
Forget namespaced tags for a moment, how do you plan to get "the previous tag" on a single tag page?
hardikmodha commentedon Apr 28, 2019
Well, Initially, I investigated but I couldn't find a direct way to fetch the previous tag details. I found a way but it is little convoluted.
[email protected].So I make a request on https://github.com/parcel-bundler/parcel/[email protected]. (Basically,
https://github.com/parcel-bundler/parcel/releases?after=<tag_name_from_single_page>I will get the page in response which will contain pagination links. I can extract the link of the previous page and next page. From this link, I can get the previous/next tag.
It won't work for the last tag.
and for the cases when the releases are only on a single page.Do you have any other approaches in mind? @bfred-it
fregante commentedon Apr 28, 2019
Ok, then only fetch that page: https://github.com/parcel-bundler/parcel/[email protected]
@parcel/integration-tests@***), only look in that page. If none are found, ignore the tag or just use the previous non-prefix-aware tagIf we really want to add a
Nextlink we need to find a solution that does not require multiple consecutive fetches (whether it's the pagination link or the brute force). But for now we can ignore itIssueHuntBot commentedon May 11, 2019
@sindresorhus has rewarded $72.00 to @hardikmodha. See it on IssueHunt