Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCrate listings duplicated on category subpages #524
Comments
This comment has been minimized.
This comment has been minimized.
|
Ah interesting. I guess it wasn't clear that a crate would automatically be in the supercategory if listed in the subcategory. |
carols10cents
added
A-categories
C-bug
labels
Jan 26, 2017
carols10cents
added
E-easy
E-help-wanted
E-mentor
labels
Feb 11, 2017
This comment has been minimized.
This comment has been minimized.
|
The fix to this will involve changing the query that gets crates in a category to do a The test should be kind of like this keyword parameter test but will involve creating a category and a subcategory, adding a crate to that category and subcategory, and querying for the category. |
This comment has been minimized.
This comment has been minimized.
|
So I tried to write a test, I expect this version to pass: https://is.gd/1E9xIQ (this gose in tests/krate.rs) When it passes the plan is to replace What am I doing wrong? Am I on the right track? |
This comment has been minimized.
This comment has been minimized.
|
@Eh2406 so the example test I cited was with keywords, while this bug is for categories. The test code you have is still calling the code to add a keyword to the crate: One difference between keywords and categories is that anyone can add a keyword by just starting to use it on their crate. Categories are set by crates.io, so you can only use a category that exists on crates.io already. So your test will need to create a category before putting a crate in the category. An example of a test that creates a category is this one. And in this particular case, you'll want to create two categories actually: the parent category and the child category. Once the categories exist, you should be able to call Does that make sense? |
This comment has been minimized.
This comment has been minimized.
|
Yes. How long did I stare at the code without noting the |
This comment has been minimized.
This comment has been minimized.
|
So, added a test to update_crate. This test usefully tells us that the |
Eh2406
added a commit
to Eh2406/crates.io
that referenced
this issue
Feb 18, 2017
Eh2406
referenced this issue
Feb 18, 2017
Merged
Only show crate once, even if search is like several category #524 #558
carols10cents
added a commit
that referenced
this issue
Feb 21, 2017
This comment has been minimized.
This comment has been minimized.
|
Merged in #558 so this is closed now!! |
wesleywiser commentedJan 24, 2017
Some crates are being listed multiple times on the top-level category pages. For example, "Development tools":
It looks like this happens when the crate declares the top level category as well as one or more sub categories in its
Cargo.tomlfile.