-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Parse rust_version as constraints from crate datasource #26315
Comments
Currently, we're using URLs like However, seems like now we have to use Once we do that, I wonder if we still need |
I recall that there was a problem with the v1 API load for crates.io so therefore we want to hit the v1 API only if we know there's new versions |
Do you mean, if we do this constantly, the server load is too high? |
We should probably await advice from the crates team to make sure this versions filter won't cause load problems |
Actually, there is a comment in our code:
|
However, it's not obvious why one request per second. I could curl more frequently in my local setup. |
Hi @epage @Turbo87, do either of you have information on what rate limits of crates.io we should abide by default? As mentioned above, today we use queries like
The above will work quite well with our shared Redis cache in production, however we can't ensure that self-hosted users have a persistent cache so they may query such URLs once per dependency per run. In that case crates.io would be protectd by our default rate limiting per second. |
You should probably be using the Sparse Index. It is what cargo downloads and uses for resolving dependencies to then know what |
yep, the sparse index would be the best option. you can see e.g. on https://index.crates.io/se/rd/serde that it includes https://crates.io/api/v1/crates/log?include=versions (currently) includes all versions without pagination from the live database. that makes the responses somewhat slow for crates with thousands of versions (e.g. |
Regarding this issue, we could achieve its objective with sparse index, which is great news. However, for most of the package managers, we're also trying to fetch timestamps of each individual release, in order to implement policies like "wait 7 days after new release, before creating PR for it". If I understand correctly, the only place we could get these timestamps is the Probably we could use |
I'd love to have a timestamp in the Index so we can do time traveling resolving of dependencies in Cargo (rust-lang/cargo#5221). The main thing holding that back is the question of what to do about yanked packages because that is a mutable field that can change multiple times so you can't actually resolve to a specific time if yanked packages are involved. In the mean time, could both approaches work?
This is assuming |
Having the timestamp per version/release is really good to have, and it seems like the versions endpoint is the only one which has that now? |
By the way, I think we could reach |
🎉 This issue has been resolved in version 37.229.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the proposed change(s).
Parse rust_version per-version from the
crate
datasource and return it asconstraints.rust
.Example package: https://crates.io/api/v1/crates/log
The text was updated successfully, but these errors were encountered: