Aborting merged PR builds

bitbucket
#1

Hello!

When we finalize a PR, we rebase and then fast forward merge. When we rebase a PR, bitrise starts building (because we enabled that webhook) and then when we merge, we close the source branch and then bitrise build fails because git clone fails. Is there any way to abort a build when a PR is merged? Or postpone a build after PR is updated?

Kind regards

0 Likes

#2

Hi @bahadir.onc!

Of course, there are multiple ways to do so :slight_smile:

The evident one is of course with the on-site button, but you could also use the API to do so. https://devcenter.bitrise.io/api/build-trigger/#aborting-a-build

Another feature we have that could help this situation is set up so you have to manually approve PR builds to run. You can read more about that here: https://devcenter.bitrise.io/builds/triggering-builds/approving-pull-request-builds/#approving-the-pr-build

0 Likes

#3

Thanks for the help, @bitce

These options are not the ones we’re looking for. We though about something like:

  1. When the PR is merged, bitbucket calls bitrise webhook/api to abort the PR
    or
  2. PR building job is delayed for a couple of minutes so when we merge, the job is never run.

The API approach is the closest thing we can use, but we’d need to implement our own server which uses both bitbucket and bitrise API’s, right?

Regards

0 Likes

#4

No, you’d just need to make a call for the Bitrise API :slight_smile: If you could find a way to automate that based on merges, that would be the ideal solution, otherwise I’m not sure you could get Bitbucket to send these requests or delay a hook :confused:

0 Likes

closed #5

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

0 Likes