-
Notifications
You must be signed in to change notification settings - Fork 192
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
Fixes #2944, #2947 - Read experiment variation values from envvars #2951
Conversation
Oops, wrong bug number. :) Will fix the commits. |
e91f755
to
6fbfaa1
Compare
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.
some modifications and comments.
Thanks a lot @miketaylr for working on this.
I was thinking of a different approach that can be something like that: johngian@0662bf1 The reasons that I came up with this is that if something goes very bad and we need to override the A/B testing cookies (in our case Other than that, this solution also looks OK. |
Looks good to me -- so the idea is to export a JSON string as an env var? I've never done that, but My only concern is writing out complex JSON by hand is error-prone, maybe it's useful for us to write a tiny script that will echo it out for us? Or do you have any other suggestions? |
^^ @johngian |
@miketaylr I haven't really thought about that since its more a once-off thing (writing the config i mean) and if you are really careful and pass it through a JSON linter you are probably good to go. It feels like writing a script to generate a JSON for the config its too much for our case. |
thanks -- i think let's just go with this approach and i'll file a follow-up to simplify things via JSON parsing (more simple implementation, slightly higher risk). i'll work on addressing feedback. |
the issue with a JSON file is that we are back to square one. As something which is dependent of a deploy (If I got what was proposed) |
I think the suggestion is to use a JSON string, not a file. So you export a var that contains JSON, rather than read it from disk. But I guarantee I will misquote the JSON and everything will fail. 😄 |
fba6b97
to
ec1a7e7
Compare
I think I addressed all feedback, r? @karlcow Right now, if |
OK, not 100% sure I love this implementation, but it works and the tests pass. (It doesn't feel very DRY, but I'm not sure I care. It would have been nice to be able to read the r? @karlcow |
(before merging, we should probably squash this into a single commit -- i'm happy to do so) |
This will also fix #2947 because by default the variables won't be set, and it will only serve v1 of the form (which tests rely on). |
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.
Thanks @miketaylr
yeah the code seems heavy, but I'm not sure I have a better proposal right now.
And add tests Issue #2944 - Address review feedback. Co-Authored-By: Karl Dubost <[email protected]> Issue #2944 - Fall back to defaults if there is a problem with AB config
00e2de6
to
8ae98df
Compare
ok squashed committed. Let's run CircleCi and wait a bit. |
merged |
This feels maybe slightly hacky -- we can't safely store a tuple in an environment variable, so it build one up from something like
0 20
. Open to other ideas.And add tests.
r? @johngian @karlcow