I know it's been 2 months since my last post but I've been a busy guy working on a bunch of projects, and I figured I'm long overdue for an update.
First, I've been working on a GitHub repo to solve a problem for a lot of developers out there, and it's a framework around FeatureFlags. You can find it here:
What are Feature Flags?
I'm still working on the documentation around it, but essentially the elevator pitch is that FeatureFlags are a necessary part of Agile deployments, and DevOps. I regularly get told the following:
"We can't deploy every 2 weeks because some of the work we do takes longer than 2 weeks to complete."
Which I always found as a funny statement, because it implies that you are unique in that way. The truth is that EVERY development shop has changes, features, enhancements that take longer than 2 weeks to do. This is not something new, and there is an answer to that problem, FeatureFlags.
FeatureFlags is this concept of building a structure around your features / application code that allows you to turn features On/Off as needed. So if you are working on a feature that is only 50% done at the time of deployment, then you would turn it off and deploy the code to production with it being hidden away from any user. This allows for a great amount of flexibility in how your applications are deployed and developed.
What Did You Build?
What I've created here, is a framework for implementing FeatureFlags internal to an application, and having those flags be controlled by the database. This allows for adding a flags around code to enable one of 3 states:
- On: The feature is currently turned on and available to everyone.
- Off: The feature is currently turned off and available to no one.
- Preview: The feature is currently "in preview" and available to select users for their review.
This enables you to either disable access to elements within your application or even who controllers or action methods.
This code leverages Entity Framework 6.1.3 code first to enable you the ability to generate the necessary table structures on the fly, as well as implements a structure around the Dependency Injection to allow you to implement this into your application along with the necessary request filters.
I would invite you to review the code and encourage implementing this within your application.
Next Steps
For this project, I am working on breaking it up into NuGet packages which will be made available on NuGet.org. And updating the GitHub documentation to guide implementation of this framework.