Unleash / unleash

Open-source feature management solution built for developers.
https://getunleash.io
Apache License 2.0
10.96k stars 686 forks source link

feat: Support smaller steps to Gradual rollout percentage #7650

Closed dbgsprw closed 1 month ago

dbgsprw commented 1 month ago

Describe the feature request

I want the Gradual Rollout feature percentage steps smaller than 1% (e.g., 0.1%, 0.01%)

Background

In services with a large user base, releasing updates in 1% increments represents a significant proportion. Therefore, finer granularity helps prevent the spread of bugs and is advantageous when testing with small client groups.

Solution suggestions

Instead of using the constant value normalizer (100) in the SDK, Get all flags (SDK) API provide additional param, Max Rollout Percentage value(e.g., 100, 1000, 10000, ...). The SDK will use both the Rollout Percentage value and the Max Rollout Percentage value together to determine the rate.

If you want this feature, I can create the Pull Request.

chriswk commented 1 month ago

Hi @dbgsprw - We're not going to do this right now, adding the possibility for this to all SDKs is not a small task, we've noted your request though, and might consider something like this in the future

If you want something similar you could solve it by creating a constraint where your resolution is whatever you'd want it to be. You won't get a slider to adjust the rollout percentage, but you could get whatever resolution you'd like

  1. Setup a default strategy (enabled | disabled)
  2. Configure custom constraint field named userHash
  3. Configure constraint on strategy to say userHash LTE 90000 (if you want to have 100000 increments and do 90% rollout)
  4. When building your context, find a consistent hashing algorithm (we use murmur3) to hash whatever value you want your stickiness to be on. We use (userId, sessionId, random or customer choice) concated with the _<name of the feature>
  5. Hash your value and then do modulo [maxvalue] on your hash (value % maxValue)
  6. Insert the result of the modulo into your userHash field in your context.
  7. Evaluate the toggle with your context, gradual rollout is now applied with more fine grained increments