I've recently joined a new company and they've been experiencing some issues related to their branching strategy which causes untested code to be released inadvertently.
We have three branches of interest:
- main: this is the branch we release from
- develop: this is the branch that contains code that is yet to be tested and merged into main to be released. We deploy a development environment from this branch and this is also where QA is done
- feature: this isn't an actual branch - these are branches that individual developers branch from develop and work on a specific feature to merge into develop
Here is one issue we're facing. Let's say we have developer A and B working on feature A and B, respectively.
- Developer B finishes first and merges feature B into develop
- QA begins testing feature B
- Developer A finishes feature A and merges it into develop
- QA finishes testing feature B but they do not have time to start testing feature A because our customer's deadline to release has been reached
- Devs prepare the release by merging develop into main and releasing the stuff on main
The issue here is that main now has feature A which is untested!
Usually the way this is addressed is that a "hotfix" is made where feature A is reverted on main. However, I think in this case prevention is better than the cure. What kind of branching strategy would you recommend so that we don't end up in this position where work has to be reverted on main so it does not end up in the next release when it shouldn't be?