- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.7k
          Add a success message on publish to crates.io
          #11977
        
          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
Conversation
| Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label ( 
 | 
| // Print success note on publish | ||
| if opts.registry.is_none() { | ||
| if let Some(ref registries) = pkg.publish() { | ||
| if registries[0] == CRATES_IO_REGISTRY { | ||
| if let Ok(packages) = opts.to_publish.get_packages(ws) { | ||
| for package in packages { | ||
| opts.config | ||
| .shell().note(format!("Your crate was successfully published to crates.io! You can visit it at https://crates.io/crates/{} .", package.name()))? | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current cargo publish output isn't very helpful or gives a lot of feedback.
It's something like:
And that's it, it ends with a boring "Updating index" message. I
The message you showed I'm assuming is from a stable release.  As you saw in the test, master already ends with
    Updating crates.io index
   Packaging delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
    Packaged 3 files, 761.0B (569.0B compressed)
   Uploading delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
    Uploaded delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
note: Waiting for `[email protected]` to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
     Waiting [===>                       ] 11/60
   Published delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo) has been successfully published to registry `crates-io`
See #11713
Adding another success message feels a bit excessive in the amount of output we are showing the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're right. I guess I just have a weird / old version (I made the issue in February, maybe the stable ver. there has changed a lot?)
Anyways, I'm going to close the PR
| if opts.registry.is_none() { | ||
| if let Some(ref registries) = pkg.publish() { | ||
| if registries[0] == CRATES_IO_REGISTRY { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking only the first of the potential registries doesn't seem right.
We should instead check what registry we actually published to
| Sorry for wasting your time. | 
Fixes #11768
Adds a success message when publishing a crate to crates.io (only crates.io).
Why?
The current
cargo publishoutput isn't very helpful or gives a lot of feedback.It's something like:
And that's it, it ends with a boring "Updating index" message. It could be very handy if, after a publish, Cargo printed the URL to the crates in crates.io along with a success message with some more ✨ Magic ✨
This PR adds a message that congratulates the user for publishing their crates, so it feels better to publish a crate!