Feature flags, also known as feature toggles or release toggles, allow you to enable or disable specific functionality in your software without updating the code itself.
Feature flags are particularly useful if you’re practicing CI/CD with trunk-based development, as they allow you to keep merging to and deploying from master without immediately making new features available to users. Separating deployment from launch also makes it easier to coordinate product and marketing efforts with the availability of a new feature.
You can implement feature flags with a simple configuration file, allowing you to enable a feature in some environments (such as testing) and disable it in others (such as staging and live). Bear in mind that using feature flags extensively adds complexity, and it can involve considerable manual overhead to maintain them.
If you find yourself dealing with more than a handful at a time or want to use feature flags to run A/B tests on users, you may want to consider using a database or dedicated tool to make management easier.
Take your automated CI/CD pipeline to the next level with configuration as code.
How do you configure your CI/CD jobs to build pull requests? The Pull Requests build feature in TeamCity makes it possible to automatically detect and build pull requests from GitHub, GitLab, Bitbucket, and Azure DevOps.
Like tabs versus spaces, branching strategies is one of those emotive topics that trigger heated debates both online and offline.