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:
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?
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.
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.
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:
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:
integration
for a formal client review and approval of the featuredev
, 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
)
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 :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With