Our team has recently implemented a gitflow strategy for managing our code base. In simple terms, the strategy is
As you can imagine, after a while, theres a set of Open PR's in BitBucket to be merged into release branch. Each related to different feature branches.
Then, one developer, due to a hotfix, for instance, merges a specific feature branch to that release branch and some of the previous PRs get merged also with the message that <developer> remotely merged <feature> into <release>.
And that's not really the intention here. We should be able to merge ONLY the specific branch intended to.
Can you please assist in what are we doing wrong?
Hi @jploureiro ,
welcome to the Atlassian Community!
I would suggest you change the way how you handle hotfixes - process them differently using another branch like is described here - basically create hotfix/xxx branch from the master branch and merge there the changes (if you want to do the code review, use pull request). Then merge the hotfix branch to master and develop.
Thank you for the reply.
That's exactly what we're doing. We're creating a hotfix/xxx branch from master. The problem occurs when we have to merge this branch back into the infinite branches (develop and quality).
The issue here is not with the hotfixes. It was just an example. Even feature branches, when we try to merge one specific branch into 'quality', some of the open PR's are remotely merged as well. This is the problem.
Hi @jploureiro ,
sorry for the misunderstanding. What you describe is really strange behavior. I believe the auto merge happens, if all the commits from the pull request are also in the merged pull request. Is it possible there are some dependencies between feature branches? It would be great, if you could somehow share commits to be able to see all the history of involved branches...
Is there any specific reason why you are creating pull requests to the release branch? Usually it is done against the develop branch and then everything from develop is released.
No problem, thank you for the reply.
I'm not quite sure if I fully understand what you mean but I'll try to respond. For instance, when you say "if all the commits from the pull request are also in the merged pull request", how could one commit be in 2 different pull requests? What we usually do is only one commit per feature branch and, when done, immediately create a PR to the release branch.
Another thing "Is it possible there are some dependencies between feature branches". I don't think so. Every developer updates the same code base in each feature but I don't think that is creating a dependency.
How can I share the commits with you?
We also merge every feature branch to develop, but we need the release branch because we can not release everything in develop since there's work in progress that can not be released just yet.
Sorry for all the doubts but this process is relatively new for the team.
Hi @jploureiro ,
"how could one commit be in 2 different pull requests?" It is possible, for example if one feature branch is created from the second feature branch, when there are already some commits. That's why I've asked about the branches dependency. But it doesn't seem to be your use case.
If your create some blank test repository - are you able to reproduce this behavior?
Maybe if you can share commit graph for all involved branches, it would help determine, where the problem could be.
Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events