-
Notifications
You must be signed in to change notification settings - Fork 212
use crates.io search to search crates #1521
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
Conversation
( creating this as draft since I'm offline most of the time, but wanted to start the review to safe time in the end ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's confusing to review both the added pagination and the new search behavior at the same time - do you mind splitting them up into different PRs? Note that the pagination fixes #788.
(I didn't do a very thorough review here yet.) |
The pagination PR would have to be based on the api-PR, |
If you just put them in two commits in the same PR, that would be fine too :) |
f9c5ffd
to
9b0f8ff
Compare
I have split this into two separate commits, other fixes I postponed until after the proper review. I hope the changes are easier to understand now :) |
I think we should match the other releases. @Kixiron I don't remember why we used exactly the logic we have currently; I suspect you were just trying to match the other releases and we changed the logic in the meantime?
👍 this seems good, can you open an issue for it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good to me, just a small nit. It's kind of broken locally because my database doesn't have almost any of the crates on crates.io, but I don't see a good way of fixing that and still using crates.io search.
This is probably #708
In theory we could have a fallback/config for local development that just does |
@jyn514 was something missing here or can we merge? |
This removes our own custom search with an API-Call to crates.io.
Most of the actual API-call is based on #1224, while I reverted some parts of it.
I added
rustdoc_status
to thematch_version
output so thesearch_handler
looks better.Since crates or versions returned from the crates.io search might not exist in docs.rs yet, we are
next_page
andprev_page
values coming from crates.io, following what @pietroalbini said in the chat.My thoughts on the version being shown:
IMHO using
max_version
ormax_stable_version
from crates.io is out of the picture since it might not exist in docs.rs yet.Other release-list pages use
crates.latest_version_id
, which is why I was thinking of using this version, but since this would be changed behavior I left the version logic as-is.for the future
I believe we should change the content of
crates.latest_version_id
to matchCrateDetails.latest_release
. Then a click on the release-lists or search-results always takes you to a version without a go to latest version link.So you don't have to look it up, we are showing the semver-highest version which is not yanked and no prerelease. What is different compared to the current version showed by search is that the
latest_release
definition includes releases with failed builds.But I would change this (and we can discuss details) in a separate PR.
Related issues: #708, perhaps #1009