Reputation: 301
I am using Git-Flow for a work project and cannot settle on the best way to deal with the following situation:
Developer Anya creates a feature [Feature1]
Developer Fred creates a feature [Feature2]
Both developers have finished their features to spec and now want to put them into a staging server for Q&A/approval for the next release.
The options I see are as follows:
Both developers finish the features which merge them into a development branch. The staging server has the development branch checked out.
The problem here is let's say that during the testing of Feature2 it is found that there is a bug, or that there is an unforeseen enhancement which could be added, perhaps it is even abandoned, or delayed indefinitely. Now all features are held up and the release is delayed until Feature2 is fixed/satisfies the new spec, or we revert the merge and reopen the feature and the release gets under way. Is this an acceptable solution?
Another option is that a 3rd separate branch exists called staging. Developers individually merge their features into the staging branch and push to the staging remote where each feature is tested. The feature is only finished and merged into the development branch once it has been approved.
The benefit of this approach is that the development branch basically only contains approved features and a release can be taken from it at any time. The downside is that we would need to switch the staging server to checkout the development branch so that everything can be tested during a release phase. Also, the staging branch may diverge from reality if features are abandoned or some other reason that I can't think of right now, meaning it needs to be rechecked out from live(?) periodically.
I realise that this is probably a problem that deployment pipelines and CI fix but I am curious as to how others solve this using a git branching model or Git Flow.
Upvotes: 0
Views: 571
Reputation: 38136
Since code from feature branches need to be tested/approved by QA, developers can push the feature branches to remote and QA merge/test feature branches separately. Even one of a feature branch is not approved, it won’t affect other feature branches to release new version.
Upvotes: 1