-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
scripts/g.extension: make GitHub REST API server rate limit error message more verbose #2193
scripts/g.extension: make GitHub REST API server rate limit error message more verbose #2193
Conversation
If I understood comments by @lucadelu and @petrasovaa correctly, they are sceptical of using the API in general. And if use of the API impedes installation of AddOns (i.e. requires users to wait before they can install more addons) or leads to inconsistent behavior, then I fully agree that we should not use it and rather look for other solutions. We have three relevant use cases as far as I can see:
And in all three cases we should make sure that the user does not hit the 60 requests limit or is not able to proceed because of the lack of internet connection. So, your approach with generating a JSON file with commits and commit dates in a github action (#2140) seems like a good use of Github specific features that (similar to the unit tests) could be adjusted if we should decide to move e.g. from github to gitlab if we feel that is necessary one day. Unfortuntely, also download of artifacts is limited to 60 requests. So, maybe the JSON files could be published as GIST, like e.g. here: https://github.com/marketplace/actions/deploy-to-gist so we can circumvent the API? The advantage with using git specific features here is that anybody with repo access can contribute to maintenance... However, for ofline usage, the JSON file either needs to be part of the published code or not be required at all, so mkhtml should likely behave as follows:
|
In general, this is a good solution (using the remote REST API, if we have full control of it) given the options we have and this PR improves it. All request/response exceptions (HTTPError, URLError) associated with the GitHub REST API call are handled correctly, even during compilation (see explanation diagram). Only marginal case remain problematic. In the case of
When we want make new release (source code without Git), person which make this release via GitHub page, first download
Yes it will, see my comment above. |
Using GitHub REST API was replaced with Git program in major 8.3 version. |
Making GitHub REST API server rate limit error message more verbose with date time when rate limit will be reset.
Addon installation via g.extension module depend on make request/response to GitHub REST API server (which has limitation), to obtain addons paths (create addons_paths.json inside ~/.grass8/addons/ dir), required for addon path detection, for making addon source code URL and source code history URL, which appears on the man page. An additional request/response is required to obtain the last commit for the addon, which appears on the man page as commit and commit date. Fixes #2186 issue, when addons_paths.json doesn't exists and GitHub REST API server rate limit is already exceeded.
How to test this PR.
Scenarion A:
Scenarion B: