Skip to content
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

Latest prerelease does not fetch properly #12

Closed
beam41 opened this issue Sep 27, 2022 · 12 comments
Closed

Latest prerelease does not fetch properly #12

beam41 opened this issue Sep 27, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@beam41
Copy link
Contributor

beam41 commented Sep 27, 2022

Currently launcher show latest prerelease at cf6de24 even though we have newer commit on develop.

image

I figure out what happen. If we use postman to fetch release from github api directly.

curl --location --request GET 'https://api.github.com/repos/Limetric/OpenRCT2-binaries/releases' \
--header 'Accept: application/vnd.github+json'

First tag name will be match with first result in the release page and so on.

image
image

That mean this api sort by tag name string same as the release page, and that why newer commit on develop doesn't appear because tag start with f come first.

Look at the documentation, there is no way we can sort by publish date, but we might be able to fix by expand result to cover all commit in major version. (Which is not really viable)

Graphql version can be sort but need authentication though.

image

@karst
Copy link
Contributor

karst commented Oct 4, 2022

It seems to skip all versions that start with a number.

@beam41
Copy link
Contributor Author

beam41 commented Oct 4, 2022

It seems to skip all versions that start with a number.

Number comes before alphabet (at least in computer) and it sort in descending order. So that's why.

@karst
Copy link
Contributor

karst commented Oct 4, 2022

well it's not sorted alphabetically, it's sorted by the release time. In this list at least.

@beam41
Copy link
Contributor Author

beam41 commented Oct 4, 2022

well it's not sorted alphabetically, it's sorted by the release time. In this list at least.

I'm talking about this list which sort alphabetically and we only get top 50 from them. So that why it miss some recent releases.

@IntelOrca
Copy link
Owner

@beam41 do you know if a GitHub app (no specific repo installation) could be used to authenticate either the REST API or the GraphQL API?

@beam41
Copy link
Contributor Author

beam41 commented Oct 5, 2022

@beam41 do you know if a GitHub app (no specific repo installation) could be used to authenticate either the REST API or the GraphQL API?

GitHub Apps can be use to authenticate both api.
https://docs.github.com/en/rest/guides/getting-started-with-the-rest-api#about-tokens
(This is docs for REST API but GraphQL API works the same)

@beam41
Copy link
Contributor Author

beam41 commented Oct 5, 2022

Actually I think you mean "OAuth Apps"

@IntelOrca
Copy link
Owner

@beam41 no, I mean a GitHub App, one that you create on GitHub with a private key and authenticate using a JWT. So the user of the launcher does not need to authenticate, it just uses a shared private/public key for the GitHub App.

I am just wondering whether the GitHub App can use the GraphQL API for finding releases without needing to be enabled/installed for a specific repo - since it is a public repo.

@beam41
Copy link
Contributor Author

beam41 commented Oct 6, 2022

https://developer.github.com/changes/2018-04-30-graphql-supports-github-apps/
From this blog it needs user authorisation to do that??
I tries github app token without user behalf and it failed.

@IntelOrca
Copy link
Owner

@beam41 that is a shame. I am not sure how best to resolve this issue without requiring the user to authenticate with a GitHub account. There are over 3,300 releases on the repo and the maximum number of releases you can query is 100, so that is at least 33 / 60 requests to get them all and it takes time to do a query that large.

@beam41
Copy link
Contributor Author

beam41 commented Oct 6, 2022

The best I can think is small api server fetch Github releases from Graphql

@IntelOrca
Copy link
Owner

As a temporary measure, https://api.github.com/repos/limetric/OpenRCT2-binaries/releases/latest can be used to get the very latest build that was pushed.

@IntelOrca IntelOrca added the bug Something isn't working label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants