-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Request api token if necessary instead of error after building when publishing a crate #6847
Comments
I can take a look at this. |
For my own benefit at least, here is the relevant control flow on the current master:
|
So it looks like we could run the auth token check from I'm not sure what automated testing is already done on this part of the code base, I'll take a quick look at that next. |
grepping for the error message "no upload token found" reveals 2 call sites and 2 tests:
So this error is already tested and the tests should still pass if the error message is returned earlier, so I don't anticipate changing the tests substantially. |
Hmmm, I wrote code for this and then realised it's not I-nominated yet, as required by the contribution guidelines. I'm asking in Discord about it but until I get a reply the changes are on my branch here: https://github.com/fluffysquirrels/cargo/tree/validate-login |
Validate registry token before operations that require it. Fixes #6847 .
Describe the problem you are trying to solve
I forgot to login before using
cargo publish
. It started building the crate to verify it, but when it was finished it gave an error about not being logged in. When I logged in I had to wait for it getting built again.Describe the solution you'd like
Either error immediately after running
cargo publish
without logging in first or ask for an api key.The text was updated successfully, but these errors were encountered: