-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(flags): Create an experiment from a feature flag #27938
Conversation
If you have an opinion, a couple bits I'd love feedback on:
|
Size Change: +31 B (0%) Total Size: 1.16 MB ℹ️ View Unchanged
|
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
After thinking about this for a day, I don't really see the appeal – I feel like adding the big checkbox at the top of the flags creation UI experience that gives folks the option of making a relatively incomplete experiment (compared to the amount of options they have when creating an experiment from scratch) doesn't really add much. Is this in response to customers asking to have the ability to create experiments from the flag UI? Or was this more of a "we can do this easily, so we should"? If it's the latter, my perspective is that I don't think the value add is worth the cost of adding UI clutter to the flags page. |
@dmarticus To clarify, are you reacting to:
My original question was about the latter, but it seems like your comment is in response to the former (the current PR).
This PR is in response to at least a few instances I've seen of "how do I use my existing feature flag with an experiment?" Ostensibly, they go about setting up the feature flag in their codebase first, and then realize it's not possible to create an experiment with that feature flag. Although, now that I'm saying that, maybe the more appropriate implementation is the ability to associate an experiment with an existing feature flag.
It seems like a little bit of a problem that there's zero screen real estate for experiments on the flags page. What do you think would be more appropriate? |
First pass: #28004 CleanShot.2025-01-28.at.16.58.39.mp4@jurajmajerik @andehen What do y'all think? |
@joshsny ^ If you have some opinions, given you've been working in the area recently. |
@danielbachhuber thanks for picking this up! #28004 feels like a much more useful implementation - I've often created a flag for testing, switch it on and off etc. and only later decided to run an experiment, so being able to do that feels really helpful. I think as @dmarticus mentioned for this PR, the additional real estate used in the flags page probably isn't worth it, as if I knew I wanted to create an experiment when creating the flag I'd have probably gone to the experiments page from the get go |
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 don’t have strong feelings about this. The visual clutter from this extra field IMO doesn’t seem too bad, but if a user wants to create an experiment, it indeed makes more sense for them to do it from the Experiment form. That said, adding this does improve visibility and cross-sell for experiments, which is not an insignificant benefit.
UI experience that gives folks the option of making a relatively incomplete experiment
The only issue I see is that this always creates a Product Experiment. It would need an option to choose between product and no-code experiments in the future. Any other option is easily configurable in the draft mode.
If it does come to merging this, it would be good to add a link to the newly created experiment in the success toast, opening it in a new tab.
Linking an existing flag is definitely useful and has been requested quite a bit 👍
shoot, I had a writeup from yesterday that I forgot to save, and both Juraj and Josh covered the points I was trying to make. So I'll just say:
This is what I'd recommend for the creation experience
Agreed this is most useful Looking at the UI again I think this all makes sense. I'm fine with it. |
I think I like my other PR better 😄 Ready for initial review: #28004 In particular, I'd like a second pair of eyes on the validation logic for determining whether a feature flag is eligible to be assigned to an experiment. |
Changes
Allows an experiment to be created when creating a feature flag:
experiment_set
is set to'new'
. This is somewhat magical reuse of theexperiment_set
property, which is read-only and includes an array of experiment ids attached to the feature flag.CleanShot.2025-01-27.at.13.17.10.mp4
How did you test this code?
Manual review. Tests should pass.