-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offline Mode: Switch to local feature flag #23105
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well!
/// If the feature flag hasn't been assigned to a rollout group yet, assigns the flag to a group. | ||
/// | ||
private func rolloutGroup(for featureFlag: RolloutConfigurableFlag) -> Int { | ||
let key = key(for: featureFlag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to assign more than one group (one per flag). The same group assignment can be used for all flags. If there is only one group key, it might also be beneficial to cache it in memory for further invocations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! 830970b
/// To set a percentage rollout, return a value between 1 and 100 inclusive. | ||
/// If a percentage rollout isn't applicable for the flag, return nil. | ||
/// | ||
var rolloutPercentage: Int? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Suggestion) I would suggest modeling it using floats 0.0...<1.0
to allow more granularity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! 6c81ca8
Hi @momo-ozawa 👋 , I'm bumping this PR's milestone to |
Thanks @dvdchr, I've merged this into |
Description
syncPublishing
flag to a local feature flagFeatureFlagRolloutStore
to facilitate rolling out the flag to a specified percentage of usersHow to test
FeatureFlag.swift
L45 toreturn FeatureFlagRolloutStore().isRolloutEnabled(for: self)
in order to test the percentage rollout mechanismFeatureFlagRolloutStore.swift
syncPublishing
rollout percentage set to 1%syncPublishing
rollout percentage set to a value higher thanassigned rollout group / 10
(e.g. if the assigned group was 120, set the rollout percentage to 13)Regression Notes
Potential unintended areas of impact
sync publishing feature flag
What I did to test those areas of impact (or what existing automated tests I relied on)
tested manually
What automated tests I added (or what prevented me from doing so)
none
PR submission checklist:
RELEASE-NOTES.txt
if necessary.