diff --git a/changelog.d/20241127_001212_kyle_branch_rename_master.md b/changelog.d/20241127_001212_kyle_branch_rename_master.md new file mode 100644 index 0000000000..c804ceee03 --- /dev/null +++ b/changelog.d/20241127_001212_kyle_branch_rename_master.md @@ -0,0 +1,2 @@ +- [Feature] Add the `TUTOR_BRANCH_IS_MAIN` variable to the template context, which is set to True for users running Tutor Main (by @kdmccormick). +- [Bugfix] Use `TUTOR_BRANCH_IS_MAIN` rather than the edx-platform branch name in order to determine which patches to apply. This way, when developers are testing an edx-platform branch that is not master but which may be *based on* master, they will receive master patches rather than release patches, assuming they are running Tutor Main in the first place (by @kdmccormick). diff --git a/tutor/env.py b/tutor/env.py index fef5f2cbed..9750913d1f 100644 --- a/tutor/env.py +++ b/tutor/env.py @@ -64,6 +64,7 @@ def _prepare_environment() -> None: ("HOST_USER_ID", utils.get_user_id()), ("TUTOR_APP", __app__.replace("-", "_")), ("TUTOR_VERSION", __version__), + ("TUTOR_BRANCH_IS_MAIN", tutor.__about__.__app__.__version_suffix__ == "main"), ("is_docker_rootless", utils.is_docker_rootless), ], ) diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index 5b155da6fa..b0e73fadbf 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -49,10 +49,10 @@ RUN git config --global user.email "tutor@overhang.io" \ {%- if patch("openedx-dockerfile-git-patches-default") %} # Custom edx-platform patches {{ patch("openedx-dockerfile-git-patches-default") }} -{%- elif EDX_PLATFORM_VERSION == "main" %} +{%- elif TUTOR_BRANCH_IS_MAIN %} # Patches in Main node {%- else %} -# Patches in non-Main mode +# Patches in non-Main mode (i.e., Release mode) {%- endif %} {# Example: RUN curl -fsSL https://github.com/openedx/edx-platform/commit/.patch | git am #}