Skip to content

Contentstore wrapper that can route requests to different implementations [FC-0138] - #39376

Draft
bradenmacdonald wants to merge 3 commits into
braden/deprecate-assetmanagerfrom
braden/contentstore-router
Draft

bradenmacdonald wants to merge 3 commits into
braden/deprecate-assetmanagerfrom
braden/contentstore-router

Conversation

@bradenmacdonald

Copy link
Copy Markdown
Contributor

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_content system 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.

@bradenmacdonald bradenmacdonald added the FC Relates to an Axim Funded Contribution project label Nov 13, 2026
@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Nov 13, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @bradenmacdonald!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform-oncall.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If 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 PR

Your 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

1 similar comment
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @bradenmacdonald!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform-oncall.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If 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 PR

Your 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Nov 13, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Nov 13, 2026
bradenmacdonald and others added 3 commits November 13, 2026 16:28
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>
@bradenmacdonald
bradenmacdonald force-pushed the braden/contentstore-router branch from 90659ca to 8295eb1 Compare November 13, 2026 23:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants