-
Notifications
You must be signed in to change notification settings - Fork 479
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
School search: experiment to try the new search technique #22441
Conversation
This allows the new search technique to be used on /yourschool by turning on the experiment by visiting: code.org?enableExperiments=schoolAutocompleteDropdownNewSearch The experiment will remain turned on until turned off again with: code.org?disableExperiments=schoolAutocompleteDropdownNewSearch
const searchUrl = `/dashboardapi/v1/schoolsearch/${encodeURIComponent(q)}/40`; | ||
const searchUrl = `/dashboardapi/v1/schoolsearch/${encodeURIComponent(q)}/40` + | ||
(experiments.isEnabled(experiments.SCHOOL_AUTOCOMPLETE_DROPDOWN_NEW_SEARCH) ? | ||
'/true' : ''); |
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.
API design is bit strange - I'd expect /enableThisThing
instead of /true
, but for purposes of this PR, it seems like you've added what you need.
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 believe that the string can have any value. I agree that the effect would be clearer if it were something like "useNewSearch" rather than "true".
You said that you want to enable this for /yourschool and this looks like it enables the new search for all uses of the auto select dropdown. If you really want it for just /yourschool then I'd add an optional parameter to I'm not familiar with the experiments functionality. Is this just to allow enabling the feature for internal trial or does it actually get used in production? If it is production, how will we collect data about which version is working better? |
I mentioned /yourschool because it was the place we know and love, but I'm fine with it going into effect for all pages that use this control. At this point it's literally just for @mirlew to play with, and my understanding is that experiments here simply offer generic support for turning on/off an experiment for the local user on their current environment if they use the enable/disable URL. |
Excited to be able to use this! @breville will you let me know what I need to do in order to be able to test it? |
Oh, I think I worked out why we were having trouble turning this experiment on sometimes. The experiment system doesn't automatically enable the experiment (and save that to local storage) as soon as it sees the URL parameter. Rather, when our code queries to see whether the experiment is enabled, the experiment system examines the URL, and only then does it write to local storage. So the real activation instructions are to visit https://code.org/yourschool?enableExperiments=schoolAutocompleteDropdownNewSearch and then type into the school search until some results come back. And the real deactivation instructions are to visit https://code.org/yourschool?disableExperiments=schoolAutocompleteDropdownNewSearch and again type into the school search until some results come back. If I use this experiment again I'll make sure to retrieve the enabled state immediately upon page load, rather than in some user-driven behaviour, and I'll make sure the instructions give the correct page's URL so that that code is called. |
Good find. I might have known this but for some reason didn't think of it in related to what you were working on. Glad you figured it out! |
Thanks for letting me know! I'll save that URL for future testing |
This allows the new search technique to be used on /yourschool by turning on the experiment by visiting:
https://code.org?enableExperiments=schoolAutocompleteDropdownNewSearch
The experiment will remain turned on until turned off again with:
https://code.org?disableExperiments=schoolAutocompleteDropdownNewSearch
The new search technique is found in #21995