Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git flow and multiple features waiting QA

Tags:

git

git-flow

We've been following git flow loosely at work now for the past few months, but have been running into issues with lengthy QA waits.

Here's our process:

  • developers develop locally on feature branches
  • when the team thinks the feature is ready, it's merged into dev, pushed to dev server (Codeship & rsync)
  • client approves feature
  • feature merged into master, pushed to prod

Unfortunately, the client can sometimes take up to weeks to approve a feature. It could be due to backlogs, content creation, staff turnover, etc.

However, in the meantime, a new feature may have been merged into dev and be pushed to the dev server for approval. Say this 2nd feature gets approved and needs to be deployed ASAP (of course). How am I going to get that 2nd feature off of dev without bringing the 1st feature?

like image 773
ru3sch Avatar asked Sep 03 '14 06:09

ru3sch


People also ask

What is git flow process?

The Gitflow Workflow defines a strict branching model designed around the project release. This workflow doesn't add any new concepts or commands beyond what's required for the Feature Branch Workflow. Instead, it assigns very specific roles to different branches and defines how and when they should interact.

What is the best branching strategy in git?

Build your strategy from these three concepts: Use feature branches for all new features and bug fixes. Merge feature branches into the main branch using pull requests. Keep a high quality, up-to-date main branch.


Video Answer


2 Answers

How am I going to get that 2nd feature off of dev without bringing the 1st feature?

You won't.
But once dev is merged in master, you can revert the 1st feature commits from master, in order to record that 1st feature wasn't approved yet.

This is safer than cherry-picking the commits from the second feature, as it would duplicate those commits from dev to master, and render a future merge more complex.


If this is repeated often, then the workflow isn't adapted to the current development process.

If would be best if:

  • you have an integration branch in which you merge any feature to be approved (on the dev server).
  • dev were to be updated only with approved features from the feature branch (on the dev server).

In other words, you merge a feature branch twice:

  • once in integration for a formal client review and approval of the feature
  • once in dev, with a second (and quicker) client check, to see if the feature still works as expected (since it isn't merge in the same codebase as the one in integration)

From dev, you resume your normal release management process (pushing to prod)

like image 109
VonC Avatar answered Oct 03 '22 15:10

VonC


We have this same issue in our environment, with the client taking a long time to test some features (weeks!) and approving others in the mean time that are supposed to be deployed in production.

The way we are dealing with this is using Gitflow normally and adding Feature Toggles to our features. This way, we can push the new feature code to production, but inactive due to the feature toggle. We can configure if a feature is active or not using a properties file (we are using Togglz).

Sure, the code gets a bit messier with all the "if"s, but the advantage is that if a feature that is already in production, but disabled, gets approved, we just need to change a property in a file and restart the application and it becomes active, no need to do a new release and install it in production! Also, Togglz has a feature console (which we haven't tried yet) that apparently can do the toggle in runtime.

You can learn more about Feature Toggles here. You can learn more about Togglz here and here.

I hope this helps :)

like image 43
vribeiro Avatar answered Oct 03 '22 13:10

vribeiro