However the issue with that is if you have multiple environments (e.g. three test environments, staging and production) and you want to have the code in a state of continuous deployment, then you use your branch for your feature, merge it in with this feature switch and when it gets to staging and you realise there's a bug, you can simply switch the feature off without it causing an issue rather than having to remove code from a merge.
You shouldn't merge until you've tested and are fairly certain there isn't a bug. Bugs in staging shouldn't be common and fixes should be fairly quick and easy. That's what staging is for, after all.
This is also works well for launching a feature as it's a simple on/off switch - simply git ignore the features.php file to have a different one in each environment.
5 comments
[ 4.1 ms ] story [ 26.2 ms ] threadHowever the issue with that is if you have multiple environments (e.g. three test environments, staging and production) and you want to have the code in a state of continuous deployment, then you use your branch for your feature, merge it in with this feature switch and when it gets to staging and you realise there's a bug, you can simply switch the feature off without it causing an issue rather than having to remove code from a merge.
That aside, it's very useful for launching features. I have used this practice at Expedia and works well.