How to handle the feature toggles in Continuous Integration

Hi all, this is a journey through how we did Continuous Integration in our project with Feature toggles.

A few days before the First ever release (when the feature to be released is dev done), there was a discussion on whether to do Feature branches or Feature Toggles. After that discussion we choose to do Feature Toggles as our team was growing and splitting into multiple small feature teams. I am not gonna bore everyone with why and what’s of Feature toggles as it is available all over the internet.

Back then Our CI server was just doing unit and automation test nothing more. Now there was a bigger issues of How are we going to release a new builds with some bug fixes for the old feature. Of course the answer is just to toggle off the new feature in the production environment config and deploy. But the problem here was, we were also doing a more changes on Navigation and other trivial flows which are common on to all the features.

The discussion started with the example of Navigation changes,

To accomplish the new feature the Navigations have to be changed, but it doesn’t make sense to release just the new navigation with old features. So we had them under the feature toggles and now we have two Navigation flows. What do we do we have to test both.

And then we came up this idea of Branching our CI pipelines into two layers (Development and Release).

This is behind the idea of achieving Feature Branching Advantages in Feature Toggles. How?

We split Feature Toggle configs into two environments

  • Development config — where always everything is ON.
  • Release Config — Only the currently deployed into production Feature are ON. (This is also used in times of release to turn on one particular Feature and run it through the pipelines to get it released)

Initially It was hard to split the Automation to run based on Feature Toggles, but it became easy as in when we go. Just about adding new tests and also keeping the old tests. In this case we had two different Navigation tests.

We run every commits through both the pipelines, so in order to call your story complete It has to pass through both versions of feature toggles. And thus we created a way to make every commit deployable, whenever the business wants it to be deployed.

This is how our Final setup looks like.