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

Can I do a pre-merge test in BitBucket Pipeline?

Richard Quadling August 6, 2020

So you have a load of pull requests ready to be merged to the same target branch.

They all pass their individual pipelines.

The target branch's pipeline has passed.

They can all be merged to their target branch and none of them will produce merge conflicts.

There is nothing at this point that will tell you that there is anything wrong.

Now, for arguments sake, no matter which pull request you merge first, it will cause all subsequent merges to fail in the pipeline (sometimes there's logic conflicts that are not obvious or recognised during development).

So, say one of the PRs get's merged. The pipeline runs on the merged target+PR in the target branch.

First PR merge passes.

Next PR merge fails.

As would any attempt to merge any of the other PRs.

 

What I would like to do is to have PRs pipelines to run as if they were a merge to their target.

Is this possible?

 

Also, is it possible to have all outstanding PRs run on this pattern if the target changes.


Yes. I understand that a LOT of outstanding PRs would do a lot of churn and costs in minutes.

Ideally, if a pipeline fails, putting the related task back to our "In Progress" state along with the reason ... ideal!!!

Joining up pipeline results to Jira Task statuses ... something automated here would be great.

 



1 answer

0 votes
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 10, 2020

What I would like to do is to have PRs pipelines to run as if they were a merge to their target.

Is this possible?

Yes, that is possible for PR pipelines, however the PR pipelines are not automatically re-run when the target branch changes.

From your question I read it that this is the part you're interested in.

This has been asked about before [1], and the answer was, no, PR pipelines builds are not acting as gate-keeper builds, so you need to re-run them manually and/or more automated via the REST API for each target branch update. Or just rebase all active PR branches automatically and push them again as this will re-trigger their PR builds.

[1]: Faster feedback on merges with pull request pipelines  https://community.atlassian.com/t5/Bitbucket-discussions/Faster-feedback-on-merges-with-pull-request-pipelines/td-p/960230

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events