Visualstudio: Getting "Validation Failed" error message when trying to create PR

Created on 27 Jul 2016  路  2Comments  路  Source: github/VisualStudio

Using the new 2.0 RC I'm getting a "Validation Failed" message when trying to create a PR:

image

bug

Most helpful comment

I had a similar problem, the branch I was trying to make the PR to wasn't published, to fix it I changed to the branch I was creating the PR to ran: git push -u origin MY_BRANCH and tried to do the PR again :) Hope this is useful for somebody!

All 2 comments

This is happening because there is already a PR for the branch that I'm trying to create a PR for. The error that triggers the "Validation Failed" message is a Octokit.ApiValidationException and has the following information in its HttpResponseBodySafe property:

{"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ouchmyfoothurts:test1."}],"documentation_url":"https://developer.github.com/v3/pulls/#create-a-pull-request"}

So it looks like we need to parse the HTTP response to show a more meaningful error message.

I had a similar problem, the branch I was trying to make the PR to wasn't published, to fix it I changed to the branch I was creating the PR to ran: git push -u origin MY_BRANCH and tried to do the PR again :) Hope this is useful for somebody!

Was this page helpful?
0 / 5 - 0 ratings