How to make Bitbucket PRs behave like Github
Asked Answered
I

0

6

When a pull-request is created on Bitbucket Cloud, this is the important part of the payload that gets POST'd by Bitbucket webhooks for the repo:

{
  "destination": {
    "commit": {
      "hash": "b0xxxx9b05e6",
      "type": "commit"
    },
    "repository": {
      "type": "repository",
      "name": "test-repo",
      "full_name": "ntrs/test-repo",
      "uuid": "{4exxxx51-e5df-49a7-9601-5d24cb50d3bd}"
    },
    "branch": {
      "name": "master"
    }
  },
  "source": {
    "commit": {
      "hash": "3dxxxxea3b8f",
      "type": "commit",
    "repository": {
      "type": "repository",
      "name": "test-repo",
      "full_name": "ntrs/test-repo",
      "uuid": "{4exxxx51-e5df-49a7-9601-5d24cb50d3bd}"
    },
    "branch": {
      "name": "temp"
    }
  }
}

so unlike Github, Bitbucket doesn't create some temp branch that has the merge on it - so am I expected to do the merge myself in order to create some merge commit that I can forward to get tested? As you can see all I have is the source commit and destination commit, but not a new merge commit to test.

Instauration answered 28/5, 2019 at 0:3 Comment(2)
Sounds like you're after this much-requested feature: bitbucket.org/site/master/issues/5814/…. We have worked with this limitation for some time, and our process has been to have developers create a branch in the same repo as the destination, so that the CI build can run on their branch within the repo - which gets around any permissions issues with running a build on someone else's repo. It's not ideal and we have to rely on developer discipline to rebase their changes onto the latest master from time to time if a PR is sitting for a while.Rexford
Thanks if there is a better way to phrase the question lmk, would like to help other people who have the same questionInstauration

© 2022 - 2024 — McMap. All rights reserved.