Repository navigation
Contentstore wrapper that can route requests to different implementations [FC-0138] - #39376
bradenmacdonald wants to merge 3 commits into
Conversation
|
Thanks for the pull request, @bradenmacdonald! 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. |
1 similar comment
|
Thanks for the pull request, @bradenmacdonald! 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. |
As a first step towards storing course files in openedx_content (see openedx-core ADR 0016, "Replacing Contentstore"), contentstore() now returns a RoutingContentStore which delegates each request to the backend that stores the relevant course's files. For now, the legacy MongoDB/GridFS store is the only backend, so there is no change in behavior. The ContentStore base class now documents the full interface that the rest of the platform uses, and the generic get_attr()/set_attr() helpers move into it from MongoContentStore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When an uploaded file is large enough to be written to a temporary file, generate_thumbnail() reads it from tempfile_path. For SVGs, it opened the file in text mode and passed the resulting str to BytesIO(), which raised a TypeError. The error was logged and swallowed, so large SVGs never got a thumbnail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Formally specify the format of the dicts returned by ContentStore.get_all_content_for_course() and get_all_content_thumbnails_for_course(), listing only the keys that callers rely on. The unreliable "md5" key is deliberately omitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
90659ca to
8295eb1
Compare
Description
This is one of several PRs implementing a new version of "contentstore" (the asset storage, not the CMS django app) that is capable of serving course assets from the new versioned
openedx_contentsystem rather than MongoDB GridFS.This PR simply adds a wrapper that can route requests to different implementations, and then routes all requests to the existing implementation.
This PR depends on:
Supporting information
Read ADR 16: Replacing Contentstore for details, as well as ADR 13: Shared Static Assets
Testing instructions
Make sure there are no regressions in using static assets. This PR does not make any user-visible changes.
Deadline
We just need this all finished by Willow.
Other information
I've added type annotations to the contentstore API, without changing the API contract at all. Doing so revealed a bug that would occur with generating thumbnails for SVG files over 2.5 MB in size; a pretty rare thing, but it's now fixed.