Skip to content
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

Merged
merged 2 commits into from
May 16, 2018

Conversation

breville
Copy link
Member

@breville breville commented May 16, 2018

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

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' : '');
Copy link
Contributor

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.

Copy link
Contributor

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".

@drewsamnick
Copy link
Contributor

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 SchoolAutocompleteDropdown and set it on /yourschool based on the experiment.

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?

@breville
Copy link
Member Author

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.

@breville breville merged commit 07d707f into staging May 16, 2018
@breville breville deleted the your-school-optional-new-search-ui branch May 16, 2018 05:22
@mirlew
Copy link

mirlew commented May 16, 2018

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?

@breville
Copy link
Member Author

breville commented Jun 3, 2018

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.

@caleybrock
Copy link
Contributor

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!

@mirlew
Copy link

mirlew commented Jun 4, 2018

Thanks for letting me know! I'll save that URL for future testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants