Linking Stash project pull requests?

I have two seperate repositories of code that are linked to one another. Example iOS app (Repo A) and Web API (Repo B). These repositories are developed by two different teams with two different code languages and Repo B is used by an Android app (Repo C). Because Repo B is shared by Repo A & Repo C, it does not make sense to have the code in one repositiory. I am having an issue that if a bug is found by an end user that requires a change to both Repo A and Repo B I have not found a way to link the two pull requests to one another. The reason this is require is that I want to have a Bamboo deployment plan to kick off when a commit is done to master. However, the Bamboo plan fails due to both pull requests not being accepted at the same time, therefore the repositories are out of sync.

Is there a way using Stash and/or Bamboo to have pull request dependencies within a project, so that Bamboo will not run unless both pull requests have been accepted?

If I had to merge the different repositories into one project, is there a way to treat them as different repos while being in the same for review and notification purposes?

1 answer

1 accepted

This widget could not be displayed.

Hi Tim,

There are two separate problems here.

Firstly, you need to solve dependency management between your two repositories. That is to say, when you modify A and B you need a way to specify what exact version of B is required by A. There are many different ways of doing this, either through Git Submodules or a dependency management tool like Maven/RubyGems/Eggs/NPM/whatever. I talk about this in a few places:

https://answers.atlassian.com/questions/163199/stash-using-managing-multiple-repos-simultaneously

https://answers.atlassian.com/questions/218245/typical-stash-structure

Dependency management is something you will need for having multiple repositories, otherwise you will never be able to reproduce a build ever again. For example if you change B again in a non backwards compatible way you will never be able to build A again because it wasn't specifying what version of B to use.

Now to the unfortunate part. If/when you use dependency management you won't be able to merge the pull request of A until you 'release' B, because A will have some version of B that doesn't exist yet. Unless you use Git submodules and depend on the hash of the source branch in B, although that isn't a good idea.

Regarding Stash, we don't currently support pull requests across multiple repositories. We also don't have a way of linking them. The former is going to be very hard, given how tied they are to Git repositories. It might be nice to link two though, and block one until the other is merged. That said, if you have builds set up that are building your pull request branches, they will by definition fail for repository A until B is released. You could use the 'require 1 successful build' setting in Stash to force that people can't merge until there is at least one green build, which in turn will require B to be merged.

I hope this helps in some way.

Charles

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,320 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you