Recently I was chatting with someone who had a downtime on production due to, guess what! "a feature flag toggle". Short story below. The feature flag was always in off state. Product team toggled the flag to make the feature live after 4 months. This resulted in an incident and nobody could figure out why/how for more than 30 mins. Lot of teams use feature flags as convenience to the reduce deployment risk. But this doesn't really _reduce_ the risk. The risk just moves from "deploy time" to "runtime". Now, instead of "will this deployment break?" you end up asking "which combination of 15 feature flags will break?". One advice I have is: Don't keep feature flags for months and months. Prune them and reduce the cyclomatic complexity in the codebase. Without regular care, feature flags pile up and the code becomes unmanageable. Feature flags are great for gradual rollouts. They're technical debt when they become permanent configuration. Every flag you add is a code path you need to test and maintain.
Toggle flags are code smell as per Uncle Bob
I remember in one of the team which I was we whenever introduced a feature flag we used to have a ticket raised to be high priority to get in resolved in couple of sprints Also I see some of the teams take care for testing the individual feature and integration testing of features together is kept at the end which sometimes messes up and then teams comes up with hot fixes. Rather we should have integration env where integration testing should be started atleast at 50% of the feature is developed and watch simultaneously with the features getting developed. We should have some type of strategy like Chaos Monkey where we should test by assuming something will fail. It may catch unknown bugs which are the worst nightmares.
I think if there are proper test cases written for every feature built, toggle flags can prove to be a blessing.
Thanks for sharing
Engineering Lead @ IDFC FIRST Bank | Driving Innovative Solutions
1wReading this i now realise , feature flag might be more of a problem than the value it will provide to us