-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: new flags default to 0% rollout instead of 100% automatically #13719
Conversation
Hey @liyiy! 👋 |
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.
I'd rather have the confirmation on rolling out to everyone, than defaulting to rolling out to no one even when the flag is enabled. This seems more confusing to me 😅
I think in general though the average feature flag user would think the behavior of a feature flag being created for the first time without a user intentionally enabling and rolling it out to people though should be defaulted to 0% rollout. I think we're just used to the behavior of flags being automatically rolled out to everyone because that's how we've been using posthog feature flags but I don't think that's a very secure way of preventing accidental rollouts. The case for "oops I rolled this out to people when I didn't want to" is also worse than "oops I forgot to roll this out to people when I wanted to". IMO a warning confirmation can be kind of annoying and doesn't really solve the issue because we're not fixing the problem which is the flow of the creation itself but rather putting another confirmation warning for the user to read and digest and click etc We also don't do this for experiments where experiments are rolled out and start automatically once they're created, so why do we do it for feature flags? 🤔 Anyway, if you disagree strongly based on how users think/act I'm fine with inserting a warning confirmation, I just don't think it really solves the problem 😅 and the functionality that we're used to that makes sense for us may not make sense for users |
Fair, I'm open to trying this out, you make good points! We can discuss again if feedback is negative. The code here is incorrect though: You're changing what null represents (it still represents 100% rollout - I'd be very strongly against changing what the default here means), what we instead want to change is that whenever a new group is added, the rollout_percentage is set to 0. |
yep it's just in draft mode rn, was deciding between fixing it at the backend level which would involve making a bunch of library updates too 😬 but I think I'll just stick with updating it on the FE where if the rollout % is null when you send the create new flag request, it sends in 0% rollout instead (yet to be added) |
yes, only in frontend please 😂 . Please don't obfuscate it like that - just changing nulls here to 0 should do the trick: probs worth abstracting in one place instead of all 3. |
Another component of this worth thinking through: Say I have a country=USA rollout 100% flag. Now if I delete the property filter (country=USA), does it make sense to reset the rollout to 0% as well? As otherwise, pretty counter-intuitively, deleting a condition leads to a flag being rolled out to a lot more people. 😅 |
update: Actually I think it makes sense to leave the property filter as it is so when the user is deleting the country 100% rollout property filter, they are intentionally making updates to the rollout conditions and so leaving it to whatever rollout percentage as is would be fine? We'd only want to default it to a 0% rollout when the user is not intentionally making updates or if everything resets like when we change the "match by" groups type I think that's why it would also make sense when a user clicks "add condition sets" to have those condition sets at 100% 🤔 What do you think? also @EDsCODE |
ah, no, this defeats half the purpose I think :/ . In most cases, the person who will make the mistake is someone who wouldn't edit existing conditions but add a new condition for person X, change their mind, delete the filter, and end up rolling out to 100%. So, I'd be for putting the defaults to 0% everywhere. |
No strong feelings on the delete condition, reset to 0 case |
fair! makes sense, will update |
Defaulting to 0% makes sense.
I agree with this! We shouldn't be too trigger happy with automatic changes as it could actually be more jarring. Idea I had while reading: |
Problem
New flags are automatically rolled out to everyone if a user doesn't manually update the rollout conditions. This can cause problems for users who have not intentionally wanted to roll out their feature flag just yet but may want to still create a feature flag.
We can either add a warning confirmation to every new flag created when the user does not edit their rollout conditions before clicking "create"
OR
We can default new flags to 0% rollout if a user does not intentionally set their rollout conditions
Changes
On new flags, if a user does not
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
How did you test this code?