Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

rebuild PR if destination branch is updated

Mauro Mombelli August 8, 2019

We have many people working and creating PR against develop branch.

Sometimes happen the following:

PR A is open, it add some code that call f(), pipeline build is OK
PR B is open, it add a parameter to function f(), pipeline build OK

PR B is merged in develop, develop is OK

PR A is merged in develop, develop FAIL

 

This could be prevented if after merging PR B, all open PR against Develop would be rebuild.
I know this is going to increment a lot the "cost" in pipeline for each merge, BUT is a little price I'm willing to pay to avoid Develop break.

 

Pretty sure bitbucket does not have a nice way to do it, but im open to script/api trickery

1 answer

1 accepted

0 votes
Answer accepted
Peter Plewa
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 2, 2019

Hi @Mauro Mombelli

Pipelines run on push or when manually triggered, to achieve what you're trying to do I would suggest changing the workflow of your team and make sure that before merging branch is up to date with develop.

This could be achieved after merging PR A either by rebasing PR B on top of develop or merging develop to PR B. This could be done through UI by clicking on the Sync button for the branch PR B as in the screenshot below.

Screen Shot 2019-09-03 at 12.51.15 pm.png

Any of those actions would trigger new pipeline.

Thanks,
Peter

Mauro Mombelli September 9, 2019

Thank you,

This is pretty much what i was looking for,

is there a way to disable merge (or display a warning) if not in sync with the target branch?

I want to make the process as foolproof as possible

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events