0 Concepts: Always ON feature flag
Pratik Bhattacharya редактировал(а) эту страницу 2021-12-19 17:44:01 +05:30

Always ON Feature Feature

When a feature has been rolled out successfully to all the users, the feature flag must return true for all users (all combination of Flight Context). To achieve that you will need to set a condition which returns true for all scenarios. You can do that by creating a Generic filter which Key as Enabled and Value as 1. The service checks for this special condition and for this condition the flag will always be evaluated to true. It is recommended that you create a new Stage/Ring, add the Enabled condition and activate that Ring.

This is how your feature flag will look like

{
    "name": "Always-On-Demo",
    "description": "Mail must belong to any of the configured value",
    "enabled": true,
    "environment": "dev",
    "conditions": {
        "client_filters": [
         {
                "name": "UserUPN",
                "parameters": {
                    "operator": "In",
                    "value": "tonystark@gmail.com,jarvis@gmail.com,steverogers@gmail.com",
                    "isActive": "false",
                    "stageId": "1",
                    "stageName": "Ring 1",
                    "flightContextKey": "UserUPN"
                }
            },            
            {
                "name": "Generic",
                "parameters": {
                    "operator": "Equals",
                    "value": "1",
                    "isActive": "true",
                    "stageId": "2",
                    "stageName": "Global Rollout ring",
                    "flightContextKey": "Enabled"
                }
            }
        ]
    }
}

In the above flag, Ring 2 is the global rollout stage which is enabled for all.

Clean Up

Setting the Enabled condition is a fast way to expose the feature flag, however in the long run the feature flag must be deleted from the system and the code to check the condition of the feature flag in the client application must also be deleted. As a best practice, the legacy code should also be deleted.

We recommend taking up the cleanup operation after 2 months of Global Rollout, to ensure that there are no long-term effects of the new feature and rollback to a early stage is not required.

Read more about clean up and best practices here