Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pull Request Validation

vinod lalwani July 18, 2022

Team,

I have been working on the bitbucket repo for a long time now and have been looking for PR Build validation to integrate with my pipelines exists on Azure DevOps.

Do we have any work-around or out-of-the-box feature where we can resolve this fix?

Problem Statement in detail -

Bitbucket is my code repo and the pipelines are on Azure DevOps. As soon as someone creates a PR - my pull-request pipeline gets triggered on ADO. I am looking for a solution where if my PR build gets failed, team should not have power to merge and complete the PR. 

Did someone have faced this earlier? Please help!

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 19, 2022

Hello @vinod lalwani ,

Welcome to Atlassian Community!

As long as your AzureDevOps builds are reporting their status back to Bitbucket, meaning that you can see the status of your Azure builds on the bitbucket pull requests page, you could leverage Branch permissions to prevent the PR from being merged if the build in the more recent commit has reported a failure.

Among other restrictions you can implement in your repository with branch permissions, one of them is to suggest or require checks before a merge, where you can suggest/enforce specific conditions on merges for individual branches or branch patterns. For your case, there's a specific merge check that would apply: Check for {#} passed builds on the last commit and no failed builds. This merge check will warn/prevent the user from merging the pull request if the last commit in the pull request has failed or has not met the required number of successful builds.

So in this case, you could create a branch permission for the destination branch of your pull requests and enable the merge check above.

Please note that when you select any of these merge checks (and don't have the Premium plan), we'll just warn users when they have unresolved merge checks, but they'll still be able to merge. To prevent users from merging and enforce the completion of all merge checks you would have to upgrade to Premium and select Prevent a merge with unresolved merge checks. Learn more about Premium.

Hope that helps! Let me know in case you have any questions.

Thank you, @vinod lalwani .

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events