[SE-4682] Removing invitation-only and non-catalog courses from search results - #28518
Conversation
|
Thanks for the pull request, @ha-D! I've created OSPR-5983 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
36dc91c to
4f62464
Compare
nizarmah
left a comment
There was a problem hiding this comment.
@ha-D I've tested the change and it functions as expected. However, I do have additional comments mentioned below.
I apologize for the mistake on my end regarding the django app comment. There are two main comments in the same comment:
- First is regarding the naming of the search filter generator class
- Second is regarding the django app
Let me know please when this is ready for another review 👍🏼
There was a problem hiding this comment.
Sorry I should've been clearer. Can you move the custom search class to the same directory the LmsSearchFilterGenerator is, lms/lib/courseware_search/lms_filter_generator.py?
Also, would it be possible to rename this filter generator to a name that's more descriptive regarding what the filter generator does, such as CatalogInviteOnlySearchFilterGenerator? Please note that I don't have any better suggestions, so if you have any other suggestion, please go with it instead.
Just for clarification, initially, my suggestion to create a django app was in order to utilize this filter in case the change was not upstreamed. But since we're working on upstreaming it, there's no need for creating a new django app for it.
Sorry, I missed it in the initial internal pull request you created.
There was a problem hiding this comment.
Oh, got it 👍
I'm not sure if it's better but just to put it out there, there's another approach we can take as well:
There's currently a SEARCH_SKIP_ENROLLMENT_START_DATE_FILTERING options in the settings. We can add similar settings:
SEARCH_SHOW_INVITATION_ONLY_COURSES
SEARCH_SHOW_NON_CATALOG_COURSES
Then instead of creating a new SearchFilterGenerator we can modify the LmsSearchFilterGenerator to respect these settings. This way we'd be able to configure these options separately if needed, e.g, disabling invitation-only while still allowing non-catalog courses.
@nizarmah Any thoughts on this?
There was a problem hiding this comment.
@ha-D yeah I'm a fan of adding those feature flags.
I'd like to ask though, what are your thoughts about following a similar naming pattern, SEARCH_SKIP_INVITATION_ONLY_FILTERING and SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING?
We can set their default values to True so that users interested in having invitation only and show in catalog filtering turned on can set their values False.
But yeah, in the meantime, please proceed in that direction.
We'll still have to see what edX developers think of the changes once they are done.
There was a problem hiding this comment.
Made the changes with the naming pattern you suggested
d16e833 to
2da7655
Compare
Adds two new fields to the indexed course data: - invitation_only - catalog_visibility Also adds two new settings: `SEARCH_SKIP_INVITATION_ONLY_FILTERING` `SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING` These settings can be used to filter out courses in the search results based on their catalog visibility or based on whether they are invitation-only courses.
2da7655 to
867d677
Compare
| # Override to skip enrollment start date filtering in course search | ||
| SEARCH_SKIP_ENROLLMENT_START_DATE_FILTERING = False | ||
| # Override to skip excluding invitation-only courses in course search | ||
| SEARCH_SKIP_INVITATION_ONLY_FILTERING = True |
There was a problem hiding this comment.
Can you please follow this guide to document new feature toggles?
There was a problem hiding this comment.
I added the this, but I'm a little unsure about the toggle_use_cases parameter I used. Its mentioned here that its best to avoid using open_edx however I couldn't find a better one than fit.
1648118 to
a5ba091
Compare
|
Your PR has finished running tests. There were no failures. |
|
@natabene This is ready for edX review |
|
@ha-D Thanks for letting me know, I am lining this up for our review. |
|
@bradenmacdonald Would you be interested in reviewing this? |
|
@natabene Sure, I can review this. |
|
👍 Looks good to me, thanks! Sorry for the slow review here.
@pkulkark I think you are taking this PR over from @ha-D; could you please rebase it and ping me to merge once the tests are all green? |
…-4682-custom-search-filter
|
@bradenmacdonald Rebased and all tests are passing except for the CLA one. Can we get an exception for this? Or should I close this and open a new one? |
|
@bradenmacdonald In this case it is fine to merge. |
|
@ha-D 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
[BACKPORT] fixup! feat: options for excluding courses from search (#28518)
Description
Using the following options allows us to enable searching for courses in the LMS:
COURSES_ARE_BROWSABLE=trueENABLE_COURSE_DISCOVERY=trueHowever, there are two types of courses which we would like to exclude from search results:
This PR adds the two fields
invitation_onlyandcatalog_visibilityto the indexed data for each course.It also adds two extra settings:
SEARCH_SKIP_INVITATION_ONLY_FILTERINGandSEARCH_SKIP_SHOW_IN_CATALOG_FILTERING. These can be configured to specify whether the filtering on these fields should be performed or not.Testing Instructions
Sandbox: LMS
The sandbox has four courses with the following names, with their "invitation" and "catalog" settings matching their titles:
Test - Doesn't show in Catalog - Needs InvitationTest - Doesn't show in Catalog - Doesn't need InvitationTest - Shows in Catalog - Needs InvitationTest - Shows in Catalog - Doesn't need invitationBy using the search term "test" in the course discovery page, you should only see the
Test - Shows in Catalog - Doesn't need invitationcourse.Settings
Reviewers