Show whether a crate version has been yanked.#18
Show whether a crate version has been yanked.#18mattdeboard wants to merge 3 commits intoonelson:mainfrom
Conversation
|
I need to update this to allow for edit: And actually I'm not sure if the "parse reflog" approach will still work. The reflog is basically time series data given in reverse. So maybe just parsing the JSON for each crate and all is the better way. I'll work on that. |
|
I actually never figured out how to unyank via cargo. TIL! |
Parsing the index files makes the most sense in terms of getting the package info, correct. The thing that's missing is when things happened. |
|
If we create our own command to invoke a custom command line, e.g. |
|
A long term goal of mine will be to remove the need to shell out, so if we can avoid it for this, it'd be better. I'd be happy to see a dep on |
|
@mattdeboard I took a look at the diff and I think things are looking pretty good. I had a couple of thoughts. Since the landing page currently acts a bit like an activity feed, this diff could be simplified along the lines of:
With that, we could go back to using a limit and skip the HashMaps. The How does that sound? |
The fact the crate data is harvested from the git reflog influences how I approached this. We're basically iterating over log lines, but since a single package & version pair can have multiple reflog lines, I needed a way to keep track of what package/version pairs I've already seen, and whether or not they have been yanked.
HashMap<(String, String), bool>seemed like a sensible choice for data structure here for fast lookups & duplicate elimination. Theget_publishesfunction is only responsible for generating the tell-tale data structure. The logic to "massage" that data into display format is handled infrontend::landing.