-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: set a License default value per Template #237
Comments
I just hit this rate limit and wasn't doing anything too excessive. I was attempting to view the differences in some of the templates. It was on the 3rd The primary rate limit for unauthenticated requests is quite low, 60 requests per hour. I do not think I exceeded that, but I might have exceeded the secondary rate limit as it appears that each time the
I would suggest not using the GitHub API at all. Clone and cache each of the template repositories. You can query these repositories to get the tags, their Cargo.toml files will include their license, and so on. Stale caches could be updated by pulling changes whenever a user runs |
As an extra note, the rate-limiting isn't a rolling period or similar. I was limited over an hour ago, and I'm still getting the same error. It could be that the lockout period is greater than an hour, or the lockout timer resets if you attempt another request during the lockout period, or I don't think it is the latter as I tried multiple times from different IP addresses (VPN) and wasn't able to trigger the lockout again with a single |
Aaron, apologies for the delay on this. I've implemented a fix in this PR to limit the number of queries. Regarding your suggestion to avoid using the GitHub API by cloning the repo directly, that approach won't work in our case. We're performing these queries before cloning the repo, when displaying the available templates to the users and allowing them to choose which one they want to clone. |
In the
pop new parachain
command, we fetch the license of the template the user is going to use.In case of the user surpass the GitHub API limit when generating the parachain it throws an error:
The limit is very high so is unlikely to happen, but it looks bad to throw an error because we can't fetch the license. My suggestion is to have a default value for each template. If the API call fails, we use this default value.
Alternatively, if we want to be very strict about this and don't want to return a default value, we can return an error string, but it shouldn't stop the parachain generation.
The error is thrown here: https://github.com/r0gue-io/pop-cli/blob/main/crates/pop-common/src/git.rs#L219
The text was updated successfully, but these errors were encountered: