-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix: demo course reindex fix (#37496) #37620
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
base: master
Are you sure you want to change the base?
fix: demo course reindex fix (#37496) #37620
Conversation
|
Thanks for the pull request, @zemelten! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
|
@zemelten Looking at the reported issue's logs, the main issue seems to be something realted to the S3 API and how Minio returns the HTTP reponses. You can notice this at The KeyError is over the missing "ContentLength" attribute in the response. This PR doesn't seem to address that at all. What this PR instead does is just wrap the steps in I would recommend investigating the error a bit more and identifying the right place to fix it. I heavily suspect, it might be in the tutor-minio plugin or something like that. However, I will leave this PR open for you to make verify that. Once you have ascertained that the issue is not in edx-platform, kindly close this PR. Instead, if somehow it's realted to the edx-platform, feel free to update this PR with a more appropriate fix. |
|
@tecoholic yes you're right the pr wraps the step in |
Fixes #37496: Enable demo course reindexing
Description
This pull request fixes an issue where reindexing demo courses fails, preventing search and CMS features from working correctly for demo content. The root cause was that the indexing logic assumed all courses have complete metadata and structure, but demo courses imported via
tutor dev do importdemocoursemay have incomplete metadata, missing about blocks, or uninitialized group configurations.Changes Made
1. Enhanced error handling in
CoursewareSearchIndexer.index():get_course()returnsNonefetch_group_usage()in try-except to gracefully handle missing group configurationssupplemental_index_information()(about/course info indexing) so failures don't prevent content indexingget_children()to prevent crashes when course structure is incompletegroups_usage_infoisNone2. Enhanced error handling in
CourseAboutSearchIndexer.index_about_information():modulestore.get_items()for about blocks in try-except to handle missing about blocks3. Added comprehensive test coverage:
test_demo_course_reindexing(): Verifies demo courses can be reindexed successfullytest_demo_course_reindexing_with_missing_metadata(): Tests indexing resilience with missing metadatatest_normal_course_indexing_unaffected(): Ensures normal courses are unaffected by changesDesign Rationale
The fix follows a graceful degradation approach:
This approach ensures that:
User Impact
Affected Roles:
No Breaking Changes:
Supporting Information
tutor dev run cms ./manage.py cms reindex_course --all --setupafter importing demo courseTesting Instructions
Automated Tests
Run the new test cases to verify the fix:
Expected Results
Deadline
None
Other Information
Dependencies
None - this is a standalone fix that doesn't depend on other changes.
Special Concerns
1. Error Handling Philosophy:
except Exception) which is intentional2. Performance:
3. Logging:
4. Backward Compatibility:
5. Security:
6. Accessibility:
Code Quality