Skip to content

Display most recently published version next to "last updated" time on crate show page #953

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

Open
bluss opened this issue Aug 12, 2017 · 11 comments
Labels
A-frontend 🐹 C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works

Comments

@bluss
Copy link
Member

bluss commented Aug 12, 2017

(Original issue title: Inconsistent crate info display (mixing versions) )

About: https://crates.io/crates/petgraph

The most recently released version of petgraph is 0.2.10.

The greatest version is petgraph 0.4.5.

This is inconsistent, it should show all the information from the same version:

  • Documentation is taken from 0.2.10, a version that is not visible anywhere on the page.
  • Categories (or the lack there of) seems to be taken from 0.2.10
  • Dependencies are taken from petgraph 0.4.5.
  • Last Updated is taken from 0.2.10

Unknown because they are the same across versions: License, Authors, Keywords, Repository, etc.

@carols10cents
Copy link
Member

Documentation is taken from 0.2.10, a version that is not visible anywhere on the page.

The documentation URL that's provided to crates.io is http://bluss.github.io/petgraph, without any version information. Since crates.io doesn't have anything to do with the generation of those docs, I don't think there's anything to be done here about that. I do think perhaps we could improve cargo tooling on that front, as I mused in this issue.

Categories (or the lack there of) seems to be taken from 0.2.10

Categories are per-crate, not per-version, so the latest published version is what takes effect. Is there a use case for wanting a crate to be categorized differently based on the version?

Dependencies are taken from petgraph 0.4.5.

This seems correct to me.

Last Updated is taken from 0.2.10

It seems like you're saying "last updated" should be 0.4.5 and should say something like "highest version published at", is that correct? It doesn't seem that strange to me to have the last time the entire crate was updated shown here.... what if we labeled this as "crate last updated at"?

@bluss
Copy link
Member Author

bluss commented Aug 12, 2017

The crate information page says "petgraph 0.4.5" — then it should use the documentation link from the 0.4.5 version of the package.

@bluss
Copy link
Member Author

bluss commented Aug 12, 2017

It seems like you're saying "last updated" should be 0.4.5 and should say something like "highest version published at", is that correct? It doesn't seem that strange to me to have the last time the entire crate was updated shown here.... what if we labeled this as "crate last updated at"?

I think the core of the problem is that the latest published version 0.2.10 is not visible anywhere on the page, so the information about "Last Updated" becomes very puzzling and hard to put together with the other information on the page. It would help to just put the version of the last update in this spot, if it's different from the "main" version that crates.io is displaying.

@carols10cents
Copy link
Member

The crate information page says "petgraph 0.4.5" — then it should use the documentation link from the 0.4.5 version of the package.

Then you would need to change your documentation link for each version that you publish, that would be annoying, wouldn't it? That's why I think we need better tooling on the cargo side, to make it easy to have a "main docs url", then encourage publishing at /:version_num paths beneath that, and then crates.io could add the version number to the main docs URL :-/

It would help to just put the version of the last update in this spot, if it's different from the "main" version that crates.io is displaying.

That makes sense!

@carols10cents carols10cents changed the title Inconsistent crate info display (mixing versions) Display most recently published version next to "last updated" time on crate show page Aug 13, 2017
@carols10cents carols10cents added A-ui C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works labels Aug 13, 2017
@bluss
Copy link
Member Author

bluss commented Aug 13, 2017

I want to clarify. I'm not asking to have the version of the package in the URL of the documentation.

I'm asking that crates.io, if it's displaying information for petgraph 0.4.5, it should use the documentation URL from that version of the package. The expected documentation in this case is https://docs.rs/petgraph/

(This can be verified by downloading petgraph 0.4.5 and reading Cargo.toml.)

The actual documentation URL visible right now is something different, it's taken from version 0.2.10 of the package.

@carols10cents
Copy link
Member

carols10cents commented Aug 13, 2017

I don't change the documentation URL every time I publish a package, do you? That's what would need to happen in order to make each version's doc urls go to that version's docs.

@bluss
Copy link
Member Author

bluss commented Aug 13, 2017

Again, that's not what I'm requesting.

@bluss
Copy link
Member Author

bluss commented Aug 13, 2017

I am primarily reporting what I saw as an error. Developers will decide how to fix it.

As formulated originally, “Inconsistent crate info display (mixing versions)” ; it is inconsistent because on a crate's page, the information displayed is patched together from multiple different versions of a crate. That fact is not exactly obvious to the user of crates.io.

There are multiple way to fix it, and any consistent result is fine. I propose that all fields of information should come from the greatest version (in this example as of this writing, version 0.4.5).


It will only become more common that there are multiple active branches of crates that receive releases. In this example it was because there was a breaking change in Rust, so the most recent version on the 0.2 branch was broken, hence it got an upgrade. There are more things crates.io could do to support this phenomenon better, but that's another issue.

@jtgeibel
Copy link
Member

If I'm understanding this correctly, the issue is that the documentation field (and probably others) may be overwritten with old data when fixes are backported to an old release and then published.

The two petgraph releases in question are:

When 0.2.10 was published, the old documentation links were pulled from the TOML file and overwrote the crate level information in the database.

Even a page such as https://crates.io/crates/petgraph/0.4.5, which I would expect to be version specific, shows the stale data that was written when 0.2.10 was published.

We could either track this information separately for each release, or update these crate level fields only when publishing the most recent crate based on semver.

@carols10cents
Copy link
Member

carols10cents commented Aug 13, 2017

It will only become more common that there are multiple active branches of crates that receive releases. In this example it was because there was a breaking change in Rust, so the most recent version on the 0.2 branch was broken, hence it got an upgrade.

So another fix could be, since you're publishing a new version in the 0.2 branch, and you've since changed where your docs are, the 0.2 branch should have gotten an update to its Cargo.toml to point to the same location as the 0.4.5 release does. Can you elaborate on why that's not an option? That seems most accurate to me-- are you still publishing docs at the 0.2 branch's URL?

I think the reason I'm confused is that I interpreted this:

Documentation is taken from 0.2.10, a version that is not visible anywhere on the page.

as "the version 0.2.10 is not visible anywhere on the documentation page when you click through", which is similar to this issue and this issue. It seemed to me that this was the root problem you were talking about, but now I see that you meant "the version 0.2.10 is not visible anywhere on the crates.io page for petgraph". I'm sorry for misunderstanding.

There are more things crates.io could do to support this phenomenon better, but that's another issue.

Please file more issues!

@bluss
Copy link
Member Author

bluss commented Aug 13, 2017

#894 looks like the same issue, actually. It's certainly the heart of it, even if the documentation field doesn't seem to be alone. I should have found that before filing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

No branches or pull requests

4 participants