Investigate use of Percentage of Actors Flipper Feature

As discussed in the MR !24774 (comment 286855052)

Work on the MR !24449 (merged)

Questions:

  • Can I use % of actors deployment for custom sets of users (users on a date, who chose individual, who live in a country)

Next steps: issues & MRs

  1. Chatops issue #214676 (moved)
  2. The API to use for the chatops call !29698 (merged)
  3. Example work #196799 (closed)
  4. An update to the documentation !29697 (merged)

Results

In gitlab context, flipper uses a crc32ed comparison, for each actor's id concatenated with the actor, and feature flag name:

Zlib.crc32("red_featureUser:#{actor.id}") % (100 * 1_000) < ROLLOUT_PERCENTAGE * 1_000

Flipper (and gitlab config) has the following benefits:

  1. It ensures that the same user is always in the same basket: a user always gets the feature or doesn't get it.
  2. It's a good idea to pad feature flag name (red_feature) as input to crc32. That's great because we don't want the same actor always getting every feature ON.
  3. One more goodness is that we may do "multivariate" experiments with flipper feature flags. So "all-text-reds" and "all-text-italic" feature flags would run in combination and we could get 2x2 = 4 combinations of actors.
  4. It's also cool because I can calculate if a user has the feature or no, by using postgres sql:
select crc32("red_featureUser:#{u.id}") % (100 * 1000) < ROLLOUT_PERCENTAGE * 1000]
  1. One more cool thing about flipper and the gitlab implementation is that, in gitlab we care more about "project" or "namespace" level features (compared to a consumer product which is user-focused). Flipper and its gitlab implementation is quite good for this purpose. Recent SPU and SPAN metrics (stages per user and stages per namespace) put a focus on product features on Namespace or User level mattering much.
Edited by Alper Akgun