-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(crates.io): Decorate add_owners error for missing team responses #12511
Conversation
GitHub might return a generic error if the user has not configured their permissions correctly to access a team. In this case, the `add_owners` function decorates the response error to include a link to the documentation. Signed-off-by: David Calavera <david.calavera@gmail.com>
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (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 (
|
Thanks for this! I wonder if this could be done on the crates.io side instead. Then we wouldn't need to special-case this in Cargo, and older versions of Cargo would also get the improved error message. Here's where the error is coming from in crates.io. |
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.
Oh ya agree with arlosi on in that regard. I didn't though of that.
Actually in #11505 I was expecting to see documentation improvement with some screenshots, as JT described. The error message enhancement is just a nice-to-have.
Thanks for your contribution anyway!
There are a few reasons why I didn't make the change in crates.io:
|
I agree, it would be a good idea verify that this didn't break old versions. I don't think we'd need to test every release, however.
I feel like the change would be acceptable. It's just changing the error message text. Cargo is the only supported client of crates.io. Of course, we'd need to get the crates.io team approval. I don't speak for them.
Pretty much all of the crates.io documentation is in the Cargo docs. Go to https://crates.io and click "Getting Started" and you're taken to Cargo docs. |
@calavera the implementation in the PR looks good, but I think I'd rather this error came from crates.io, rather than making a special case for it here in Cargo. Would you be interested in making the documentation updates that @weihanglo suggested here? Or possibly even making a PR to crates.io to improve the error message there? |
I'll take a look. |
I'll open a new PR with doc updates. No need to keep this code around if it won't be merged. |
* Improve error message according to rust-lang/cargo#12511 * Update tests. --------- Co-authored-by: Tor Hovland <email = 55164+torhovland@users.noreply.github.com>
What does this PR try to resolve?
GitHub might return a generic error if the user has not configured their permissions correctly to access a team. In this case, the
add_owners
function decorates the response error to include a link to the documentation.Fixes #11505
How should we test and review this PR?
I didn't see any integration test that exercises this code, but let me know if I missed where the crates api is tested.
This is what I did to test the code: