Skip to content

Commit

Permalink
feat: Use new template var TUTOR_BRANCH_IS_MAIN to fix a patching bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmccormick committed Nov 27, 2024
1 parent ec260f4 commit 463c5a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelog.d/20241127_001212_kyle_branch_rename_master.md
Original file line number Diff line number Diff line change
@@ -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).
1 change: 1 addition & 0 deletions tutor/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
)
Expand Down
4 changes: 2 additions & 2 deletions tutor/templates/build/openedx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ RUN git config --global user.email "[email protected]" \
{%- 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/<GITSHA1>.patch | git am #}
Expand Down

0 comments on commit 463c5a3

Please sign in to comment.