Backports to older releases with tutor

A few days ago, this question was raised during an OSPR review, which started a discussion in the BTR wg slack channel:

What are your thoughts on this? I’m eager to know!

1 Like

Thanks for moving the conversation to the forum @mgmdi :slight_smile: The question originated from this GitHub comment: fix: if pages and resources view is disabled, show all pages in studi… by navinkarkera · Pull Request #31892 · openedx/edx-platform · GitHub

In a nutshell, the question is about how to apply patches to edx-platform, specifically in the context of older releases.

As a reminder, we do not backport bug fixes to Open edX releases other than the current one. There is just one exception to this rule in the context of Tutor, which is that users should (as much as possible) be able to download or rebuild Docker images. This is what happened in this specific instance, as I commented here: fix: if pages and resources view is disabled, show all pages in studi… by navinkarkera · Pull Request #31892 · openedx/edx-platform · GitHub

Still, the question remains: if a user needs to apply a particular fix or feature to an older release of edx-platform, what’s the recommend approach?

In my opinion, the most simple and sustainable solution is to build a Tutor plugin that will apply a patch to edx-platform. Then rebuild the “openedx” Docker image and restart your platform to start using it. This is how it goes:

  1. Follow this tutorial to create an empty plugin.
  2. Add the following to the plugin:
from tutor import hooks

# replace <MYFORK> and <GITSHA1> adequately
hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-dockerfile-post-git-checkout",
        "RUN curl -fsSL https://github.com/<MYFORK>/edx-platform/commit/<GITSHA1> | git am"
    )
)
  1. Enable the plugin and update your environment:
tutor plugins enable myplugin 
tutor config save
  1. Build the new “openedx” Docker image:

    tutor images build openedx

  2. Start using it:

tutor local launch -I
# or just run "tutor local start -d" if your changes do not include any new migration
1 Like

It feels weird to not backport bug fixes to supported versions of edX. I am sure there is a good reason for it but I was unaware of this rule, is there a link to somewhere explaining the reasoning behind this decision?

Well, that’s the thing, you see: the only supported version of Open edX is always the current one. Backports to older releases are not supported – not just by Tutor, but by Open edX in general. This is common knowledge for those who have been around for a long time, but it’s a piece of information that’s kind of buried in the docs: Open edX Named Release Branches and Tags — Latest documentation

1 Like

Got it, thanks for link!