I am trying to check diff for the pull request using bitbucket api v2.
I am able to create the pull request using rest api but while merging I am getting merge conflicts so to check which file has conflicts, I am trying to check diff for the generated pullrequest.
But I am getting a 403 forbidden error.
Can someone please help me.
Thanks,
Farhan
@jredmond because https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/diff API officially returns `302` and many HTTP clients including .NET HttpClient does not pass authorization headers to the second request.
Side question 1: What correct way to detect that PR is merge-able. The one I posted above with API V1?
Side question 2: Any chance PR ref (https://bitbucket.org/site/master/issues/5814/reify-pull-requests-by-making-them-a-ref) will be implemented?
It seems that it happens because redirect happens and authorization headers lost when in second request. This https://stackoverflow.com/a/28671822/6733637 should help (just check for HttpStatusCode.Forbidden).
Note however that this API did not help me with finding conflicts. I finally use trick described here https://community.atlassian.com/t5/Bitbucket-questions/REST-API-how-to-check-if-a-PR-has-conflict-s/qaq-p/716529#M28184
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.