0

I have multiple features that are developed in an organization. Let's say these features are developed within a team and cross team. Lets say feature/CT1 and feature/CT2 are cross team branches. These has dependency on feature/WT1, feature/WT1.1 and feature/WT1.2. Again, feature/WT1 has dependency on feature/WT1.1 and feature/WT1.2. All of these branches are active and are worked parallelly. Also these branches can go to production at different point of time. Considering this dependency, what are the options to maintain this dependency holistically? and what would be best GIT branching strategy to be follow?

1 Answers1

0

You can use the following strategies to manage feature dependencies between branches:

  1. Sub-branch If you feature/WT1 is the root (has the most dependencies), use this branch as root. E.g. feature/WT1.1 becomes feature/WT1/1, and feature/WT1.2 becomes feature/WT1/2. This way, you can merge changes back from feature/WT1/1 and feature/WT1/2 back into feature/WT1. Be careful of the merging strategy used, as you can quickly shoot yourself in the foot.
  2. Abstraction/Decoupling Use encapsulation, interfaces, dependency injection, etc to create boundaries between parts fo the system
  3. Stubs/Mocks Depending on the type of boundaries in your code, the team working on feature/WT1 can create a stub/mock for the code in feature/WT1.1 and feature/WT1.2.
  • We have root branch which is named develop. feature/WT1 is not a root branch, but a it is a feature branch itself. I got the strategy one an seems a simple one to wrap a head around it. But what are risk involved for this strategy? For strategy 2, I'm not sure if I can isolate feature on API. There might be tangling of code while supporting different features on same module/class. I did not quit get #3. Do you have any reference/doc for this. – Tirumal Sutrave Feb 24 '21 at 05:17