Repository navigation
JS SDK: fix percentage rollouts including one extra hash bucket - #7425
Open
andywhite37 wants to merge 1 commit into
Open
andywhite37 wants to merge 1 commit into
andywhite37 wants to merge 1 commit into
Conversation
isIncludedInRollout compared n <= coverage, so a coverage of k/10000 included k+1 buckets (a 0.01% rollout turned on for 0.02% of ids). It now uses n < coverage, matching the half-open inRange check. Bump the SDK spec to v0.10.2 and add feature test cases where the hash equals the coverage exactly.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Contributor
[Medium impact] The PR appears safe to merge. Reviews (2) · Last reviewed commit: "JS SDK: fix percentage rollouts includin..." · Reviewed by Greptile |
andywhite37
marked this pull request as draft
October 23, 2026 15:48
Contributor
Author
|
Going to hold on this one until we get some other SDK changes through first. |
andywhite37
marked this pull request as ready for review
October 23, 2026 19:01
Contributor
Author
|
Now we're looking to roll this in with some other SDK changes |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features and Changes
A percentage rollout included one more hash bucket than its coverage said.
isIncludedInRolloutcheckedn <= coverage, and hash v2 returns one of 10,000 values from 0 to 0.9999, so a coverage of k/10000 included k+1 buckets. A 0.01% rollout turned on for 0.02% of ids, and 99.99% included everyone. With hash v1 (1,000 buckets) a 0.1% rollout included 0.2%.isIncludedInRolloutnow checksn < coverage, matching the half-openinRangeused for experiments andrange.build-your-own.mdx) updated and bumped to v0.10.2.featurecases incases.jsonwhere the hash equals the coverage exactly (excluded) and is just below it (included). Before this, the shared tests passed with either operator.Existing partial rollouts whose coverage is exactly a bucket value lose one bucket (for example, 0.02% → 0.01%).
The Python, Go and Rust SDKs have the same
<=and need the same change once they pick up the newcases.json.Dependencies
None
Testing
pnpm --filter @growthbook/growthbook test: all 1,221 tests pass.<=, the new "coverage equal to hash excluded" case fails.