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

Reckless: Avoid github API limits #7091

Merged

Conversation

endothermicdev
Copy link
Collaborator

Hitting the github REST API was becoming a problem (26 directories to search and a default limit of 60 github API calls per hour.) This PR drastically reduces REST API calls to search the lightningd/plugins repo. It also adds a fallback method of cloning the repo and searching locally. Then, if the repo had previously been cloned, it prefers to update and search that.

Github API calls are now ratelimited to 60 per hour.  Searching through
the subdirectory contents of lightningd/plugins will hit this limit after
two searches or installs.  The simple answer is to look for the directory
rather than verifying a valid entrypoint in a suitably-named directory
prior to cloning the repository.

Also corrects a bug that was flagging submodules as files while
populating directory contents.
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor cleanups only

tools/reckless Outdated Show resolved Hide resolved
tools/reckless Outdated Show resolved Hide resolved
Due to the API ratelimit, this allows cloning a github repo and searching
the result rather than searching via the REST API.  If a source has
already been cloned, it is fetched and the default branch checked out.

Fixes a failure reported by @farscapian

Changelog-Fixed: Reckless no longer fails on github API ratelimit.
If it has already been cloned, this is less problematic than
using the github rest API.
Git ls-tree does not report submodule contents which was not previously
accounted for.
@endothermicdev endothermicdev force-pushed the reckless-github-api-limits branch from 4b6e5c4 to f1dc749 Compare February 20, 2024 18:01
@cdecker cdecker merged commit 5c47506 into ElementsProject:master Feb 21, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants