Investigate use of Percentage of Actors Flipper Feature
As discussed in the MR !24774 (comment 286855052)
Work on the MR !24449 (merged)
-
Investigate percentage of actors as a way to distribute experiments Percentage of Actors. -
Develop chatops interface https://gitlab.com/gitlab-com/chatops/-/blob/master/lib/chatops/gitlab/feature.rb -
Update documentation for feature flags https://docs.gitlab.com/ee/development/feature_flags/development.html -
Cleanup the experiment !24774 (merged) -
How to know users which never faced an experiment
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
- Chatops issue #214676 (moved)
- The API to use for the chatops call !29698 (merged)
- Example work #196799 (closed)
- 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:
- It ensures that the same user is always in the same basket: a user always gets the feature or doesn't get it.
- It's a good idea to pad feature flag name (
red_feature) as input tocrc32. That's great because we don't want the same actor always getting every feature ON. - 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 = 4combinations of actors. - 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]
- 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