持续交付的功能标志解决方案

Feature Flags Solution for Continuous Delivery

我正在构建一个 2 周冲刺周期的应用程序。我们目前会一次性测试所有功能的推出,然后在出现问题时进行热补丁。我们的堆栈是 angular 和 mongo.

的节点

有人使用任何 SAAS 解决方案进行功能标记或其他有助于持续交付的解决方案吗?

编辑:试用 LaunchDarkly - 将 post 更新

Edit2:试用更新 - 好的,它似乎在我的堆栈中运行顺利 - 仍需要再测试几周。 Launchdarkly 功能标志设置非常简单,所以我将在此处概述。

安装SDK

ld_client = LaunchDarkly.init("YOUR_API_KEY");

传递自定义参数

var config = {"connect_timeout": 3, "socket_timeout": 3};
ld_client = LaunchDarkly.init("YOUR_API_KEY", config);

将用户属性作为 JSON 对象传递

var user = {
  "key": "aa0ceb",
  "firstName": "Ernestina",
  "lastName": "Evans",
  "email": "ernestina@example.com",
  "custom": {
    "groups": ["Google", "Microsoft"]
  }
};

一切都很简单documentation

Edit3:现在已经使用了 3 周,有了一些初步的想法。功能标记驱动开发一直很有用,尽管很难追溯地集成我们的一些更强大的功能。能够使用我们的优化目标将 launchdarkly api 用于 A/B 测试指标。

{
   "items":[
      {
         "name":"Staging sandbox - Engagement",
         "kind":"click",
         "isDeleteable":false,
         "_attachedFeatureCount":0,
         "_links":{
            "parent":{
               "href":"/api/goals",
               "type":"application/json"
            },
            "self":{
               "href":"/api/goals/54f7538f643d2ef1c6426443",
               "type":"application/json"
            }
         },
         "_site":{
            "href":"/goals/54f7538f643d2ef1c6426443",
            "type":"text/html"
         },
         "_source":{
            "name":"optimizely",
            "identifier":"2353921003"
         }
      },
      {
         "name":"Sandbox - Hover",
         "kind":"custom",
         "isDeleteable":false,
         "_attachedFeatureCount":1,
         "_links":{
            "parent":{
               "href":"/api/goals",
               "type":"application/json"
            },
            "self":{
               "href":"/api/goals/54f75390643d2ef1c6426447",
               "type":"application/json"
            }
         },
         "_site":{
            "href":"/goals/54f75390643d2ef1c6426447",
            "type":"text/html"
         },
         "_source":{
            "name":"optimizely",
            "identifier":"2222571744"
         }
      }
   ],
   "_links":{
      "self":{
         "href":"/api/goals",
         "type":"application/json"
      }
   }
}

angular-feature-flags 适用于 Angular v1.2 及更高版本。

The basic premise is you write your feature and wrap it up in a directive, then where you implement that directive in your markup you add the feature-flag directive to the same element. You can then pass the key of the flag to this directive to resolve whether of not this feature should be enabled.

如果您正在寻找 SAAS 解决方案,我知道 launchdarkly 是一个功能标记/持续交付平台。

在我的公司,我们已将 Launch Darkly and Rollout.io 用于企业级客户。

我们还使用了 Firebase Remote config,它是免费的,但不太适合功能标记。

我们最终开发了一个开源版本,它结合了 Feature Flags 和 Remote config 这两个概念,称为 Bullet Train