Skip to content

Crates who have yanked all their versions should only return name, owners, and that it's yanked #1058

@carols10cents

Description

@carols10cents

In search results and on the crate's page, we should be displaying crates with all of their versions yanked (henceforth referred to as "yanked crates") differently (#145), but the backend needs to tell the frontend that a crate is in this state.

Instructions for fixing this:

  • Add a field named all_versions_yanked to EncodableCrate and everywhere we create EncodableCrate instances, set that field to false if there exists any non-yanked versions for this crate. I'd recommend doing a select(exists()) query using diesel similar to this query
  • If we're constructing an EncodableCrate instance for a yanked crate, these fields should be changed too:
    • badges, description, homepage, documentation, and repository should be None
    • max_version should be "0.0.0"

Some other fields, like keywords and categories, are used for search/crate lists, and this issue isn't going to change search results, so I think we should still display why a crate showed up in a particular list of crates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions