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

How do you add a dependency on one pull request by another?

Derek S May 8, 2018

I have two separate projects I am working on and they are each in a different Bitbucket repo. One project, let's call it project A, uses libraries from the other project, we'll call this one project B. Now, sometimes my work will include changes to both project A and project B, which are simultaneous and related to the same open issue I am working on. For example, I may need to work with some new data in project A, which in turn will require an update to project B to actually get the data. 

At this point I am making changes to project A, pushing those changes, and opening a new pull request for a feature branch in the repo in which project A resides. At the same time, I am making changes to project B, pushing those changes, and opening a new pull request for a feature branch in the repo in which project B resides. 

An issue arises when project A, at the new feature branch, is cloned, but can't be built or compiled because it relies on the feature branch of project B which hasn't yet been cloned. This issue becomes a real problem if project A is reviewed, approved, and merged before project B.

When opening pull requests how do I specify that there is a dependency on one pull request by another, and therefore a pull request cannot be merged before it's dependencies are merged?

3 answers

1 accepted

3 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 8, 2018

We use tasks and the No incomplete tasks merge check to solve this. In the task we put the URL to the related Pull Request and mention that both Pull Requests have to be merged at the same time. 

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2018

@Derek SJust found this app, Linked Pull Requests, while looking at what was new on Marketplace.

Like # people like this
Mohan Krishan June 23, 2022

Could you please provide more details on this implementation?

Jonathan Hein September 20, 2023

Edit the branch restrictions on the repo(s) where the PR(s) is/are to be merged as the later merge(s). Add the 'No unresolved pull request tasks' option and if available, the 'Prevent a merge with unresolved merge checks' option.

Go to the PR for the same repo and on the right is the 'Tasks' section. Mention the PR there and it will block merging until someone manually checks the box

Like Mikael Sandberg likes this
0 votes
Ulrich Kuhnhardt [IzymesDev]
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 5, 2021

Bit late to the party, but here is good news. We have released pull request merge hierarchies in Pull Request Organizr via an intuitive drag and drop method to create multi-level pull request merge dependencies.

pr dependencies 2021 short animation.gif

Linking and unlinking pull request dependencies

Check out the blog ...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events