-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
pull-request: warn against attaching pull-requests to others' issues #269
Conversation
You can only attach a pull request to your own issues [1]. If there is something wrong with a pull request [2] and the user was trying to attach it to an existing issue, warn the user about this limitation. [1]: mislav#189 (comment) [2]: mislav#114 (comment)
It's a good start, but 422 doesn't always mean that this was the problem. How about not guessing, but using GitHub's API to fetch the issue in question and check ownership? Also, I believe you can turn any issue into pull request on a project that you have commit rights to, not just those that are owned by you. |
On Thu, Dec 13, 2012 at 10:02:48AM -0800, Mislav Marohnić wrote:
The warning doesn't claim that it is the problem, it just warns that
If we go down that road, we'll end up with “is this pull request
Ah, I will definitely add this to the warning message/ownership-check |
You should be getting a hash of validation errors back on a 422. Please share your (sanitized) output if you find otherwise. There are basically two checks for creating a PR from an otherwise valid Issue
|
@pengwynn Thanks for the clarification. I already show validation errors on 422s but in these cases such errors aren't displayed. I was convinced that GitHub doesn't set proper validation errors in 422 JSON response. However, it might be a bug in hub. I will look into it |
@pengwynn Yes I'm getting JSON validation errors. However the error code is vague (just says "invalid"). I will have to improve how I report these errors in the UI. {
"errors": [
{
"field": "issue",
"value": 269,
"resource": "PullRequest",
"code": "invalid"
}
],
"message": "Validation Failed"
} @wking Closing this without pulling. I will handle the error message elsewhere. |
Bah, we should be more descriptive there. I'll open an internal ticket, too. |
On Mon, Dec 17, 2012 at 11:30:09AM -0800, Wynn Netherland wrote:
I don't think I got any JSON back with my 422: $ cat data |
You can only attach a pull request to your own issues 1. If there is
something wrong with a pull request 2 and the user was trying to attach it
to an existing issue, warn the user about this limitation.
I was expecting something along these lines after @mislav's comment in #189 (3),
but I don't think a clearer error message made it into the trunk yet, so I added it myself.