-
Notifications
You must be signed in to change notification settings - Fork 645
Exact match not being obvious #493
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
Comments
Changing this bug's level to medium, because it involves a bunch of little pieces scattered all over. I think each of the pieces individually should be easy, but putting them all together might take a little while. The pieces:
If anyone wants to pick off a piece of this, I'd accept PRs for each little bit separately-- I don't think any of these individually should break other things (famous last words ;) ) |
@carols10cents I wanted to work on this and ran |
Hi @venkatagiri, there is something weird with the .env file and the way crates.io uses env vars that I was hoping to fix before I needed to document it but I haven't yet :( Could you try changing your .env file to have If you already have that, could you pastebin your .env file, without any usernames, passwords, or keys of course? Sorry about this! It's totally not your fault. |
The S3_REGION variable is empty. Here's the .env file I am using. http://pastebin.com/gLDh31Dn If you can point me to the piece of code where the S3 calls get mocked, I will take a go at debugging this and fix it. |
Hmm, strange. So in tests, the Line 86 in 4f9aeb3
The s3_proxy set in the config in the tests comes from This is where the S3 host gets constructed, so the http-data expect S3_REGION to be Something to try might be removing |
Yes. It seems to return Some("") for S3_REGION. Is this change fine enough for a pull request or is there a simpler way to fix it? vagrant@jessie crates.io $ gd
diff --git a/src/s3/lib.rs b/src/s3/lib.rs
index f4a43af..aa7d824 100644
--- a/src/s3/lib.rs
+++ b/src/s3/lib.rs
@@ -99,7 +99,8 @@ impl Bucket {
pub fn host(&self) -> String {
format!("{}.s3{}.amazonaws.com", self.name,
match self.region {
- Some(ref r) => format!("-{}", r),
+ Some(ref r) if r != "" => format!("-{}", r),
+ Some(_) => String::new(),
None => String::new(),
})
} |
That looks great to me! I might end up rearranging things if I figure out what I want to do about #470, but this looks like it would fix the problem for now. Please send this change in a PR and I'll merge! Thank you for your patience!! ❤️ |
Hi @venkatagiri, have you made any progress on this? I don't want to steal it from you if you have, but I'm thinking about using this bug at an OSS hack fest at a local college on Saturday, April 8, since it splits up into pieces nicely. If you have any part that you'd like to submit, I'd love PRs for small pieces! Please let me know if you have any pieces by Saturday, so that I'm not duplicating any of your work. If you haven't had a chance to make progress on this, no worries :) I'm happy to help you find something else whenever you have time! ❤️ |
@carols10cents, I didn't get a chance to work on this. So, go ahead and use this at the hack fest. |
To get some crates into your database to be able to test, start a psql session with:
Then connect to the database crates.io uses with:
Then insert some crates, named whatever you want. This will insert a crate named "hello":
Then quit postgres with:
|
When doing a search, a crate matching exactly the search will appear first, even if sorted by downloads. I initially thought it was a bug: #396 (comment)
Would it be possible to extract the exact match out of the list and display it differently?
The text was updated successfully, but these errors were encountered: