Prevent duplicate builds of PRs in BitBucket

peter.mihalik's Avatar

peter.mihalik

20 Oct, 2022 01:08 PM

Hello, we are using BitBucket PRs + AppVeyor PR builds, I noticed there are a lot of duplicate builds on AppVeyor. For example if I create a PR it starts a build, then I add additional reviewer +1 build, then I do that a few times + update description and now I have 1 hour of builds queued :(
I'm wondering if there is anything I can do to prevent AppVeyor building the same PR (same commit id) multiple times.

Thanks,
Peter

  1. Support Staff 1 Posted by Feodor Fitsner on 21 Oct, 2022 02:27 AM

    Feodor Fitsner's Avatar

    Right, AppVeyor kicks off a new build on every webhook call. Looks like Bitbucket calls webhook on every PR change and there is no way to distinguish between calls caused by PR details changes and code changes. Also, AppVeyor does not have automatic prevention of builds of the same commit as it could be re-build request from UI, manual re-send of a webhook or PR re-opening.

    However, you can try using AppVeyor REST API to grab the latest builds of the current project and prematurely finish build if it's the same commit and PR: https://www.appveyor.com/docs/build-worker-api/#forcibly-terminate-...

    You can see API requests on Network tab of your browser. AppVeyor web UI uses the same API.

    Hope that helps.

  2. Feodor Fitsner closed this discussion on 21 Dec, 2022 09:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac