From 6c5c8f1997379129de5b5ab62b30d4b6db9018bd Mon Sep 17 00:00:00 2001 From: Danyal-Faheem Date: Tue, 13 Feb 2024 13:57:00 +0500 Subject: [PATCH 1/6] fix: allow removal of course-authoring mfe --- tutormfe/patches/openedx-cms-development-settings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tutormfe/patches/openedx-cms-development-settings b/tutormfe/patches/openedx-cms-development-settings index bfbf031e..ec895df5 100644 --- a/tutormfe/patches/openedx-cms-development-settings +++ b/tutormfe/patches/openedx-cms-development-settings @@ -1,5 +1,7 @@ # MFE-specific settings +{% if get_mfe("course-authoring") %} COURSE_AUTHORING_MICROFRONTEND_URL = "http://{{ MFE_HOST }}:{{ get_mfe('course-authoring')["port"] }}/course-authoring" CORS_ORIGIN_WHITELIST.append("http://{{ MFE_HOST }}:{{ get_mfe('course-authoring')["port"] }}") LOGIN_REDIRECT_WHITELIST.append("{{ MFE_HOST }}:{{ get_mfe('course-authoring')["port"] }}") CSRF_TRUSTED_ORIGINS.append("http://{{ MFE_HOST }}:{{ get_mfe('course-authoring')["port"] }}") +{% endif %} From f3131b185d67ef432a65ffc90695d22c22611045 Mon Sep 17 00:00:00 2001 From: Danyal-Faheem Date: Tue, 13 Feb 2024 14:26:31 +0500 Subject: [PATCH 2/6] fix: add changelog entry --- ...0213_141934_danyal.faheem_fix_course_authoring_mfe_removal.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/20240213_141934_danyal.faheem_fix_course_authoring_mfe_removal.md diff --git a/changelog.d/20240213_141934_danyal.faheem_fix_course_authoring_mfe_removal.md b/changelog.d/20240213_141934_danyal.faheem_fix_course_authoring_mfe_removal.md new file mode 100644 index 00000000..c3fce036 --- /dev/null +++ b/changelog.d/20240213_141934_danyal.faheem_fix_course_authoring_mfe_removal.md @@ -0,0 +1 @@ +[Bugfix] Make sure course-authoring mfe is present in MFE_APPS before applying cms-development-settings. (by @Danyal-Faheem) From d662313bf36060af2ff25b89891a7f9c8b374a9b Mon Sep 17 00:00:00 2001 From: Danyal Faheem <138459282+Danyal-Faheem@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:25:27 +0500 Subject: [PATCH 3/6] ci: push learner-dashboard-dev image to Docker Hub --- .gitlab-ci.yml | 2 +- ...0221_114505_danyal.faheem_add_learner_dashboard_dev_to_ci.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20240221_114505_danyal.faheem_add_learner_dashboard_dev_to_ci.md diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20fecf02..7795af78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ variables: TUTOR_PLUGIN: mfe - TUTOR_IMAGES: mfe authn-dev account-dev communications-dev course-authoring-dev discussions-dev gradebook-dev learning-dev ora-grading-dev profile-dev + TUTOR_IMAGES: mfe authn-dev account-dev communications-dev course-authoring-dev discussions-dev gradebook-dev learner-dashboard-dev learning-dev ora-grading-dev profile-dev TUTOR_PYPI_PACKAGE: tutor-mfe OPENEDX_RELEASE: palm GITHUB_REPO: overhangio/tutor-mfe diff --git a/changelog.d/20240221_114505_danyal.faheem_add_learner_dashboard_dev_to_ci.md b/changelog.d/20240221_114505_danyal.faheem_add_learner_dashboard_dev_to_ci.md new file mode 100644 index 00000000..af8efc64 --- /dev/null +++ b/changelog.d/20240221_114505_danyal.faheem_add_learner_dashboard_dev_to_ci.md @@ -0,0 +1 @@ +-[Bugfix] Added the learner-dashboard-dev image to the gitlab ci. (by @Danyal-Faheem) From c8a816037e2f5024c947776e6621131aebda663d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Tue, 6 Feb 2024 11:41:23 +0100 Subject: [PATCH 4/6] fix: remove pkg_resources for compatibility with python 3.12 pkg_resources is a package that is unavailable in python 3.12, unless setuptools is explicitely installed. Turns out, there are replacement functions coming from importlib_resources, which can be obtained from the importlib-resources pypi package. This package will be installed with tutor starting from 17.0.2. --- .../20240212_115536_regis_pkg_resources.md | 1 + tutormfe/plugin.py | 26 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 changelog.d/20240212_115536_regis_pkg_resources.md diff --git a/changelog.d/20240212_115536_regis_pkg_resources.md b/changelog.d/20240212_115536_regis_pkg_resources.md new file mode 100644 index 00000000..35b6d201 --- /dev/null +++ b/changelog.d/20240212_115536_regis_pkg_resources.md @@ -0,0 +1 @@ +- [Bugfix] Make plugin compatible with Python 3.12 by removing dependency on `pkg_resources`. (by @regisb) diff --git a/tutormfe/plugin.py b/tutormfe/plugin.py index 421761af..ab1fe035 100644 --- a/tutormfe/plugin.py +++ b/tutormfe/plugin.py @@ -5,10 +5,10 @@ import typing as t from glob import glob -import pkg_resources +import importlib_resources from tutor import fmt -from tutor.__about__ import __version_suffix__ from tutor import hooks as tutor_hooks +from tutor.__about__ import __version_suffix__ from tutor.hooks import priorities from tutor.types import Config, get_typed @@ -168,11 +168,14 @@ def _mounted_mfe_image_management() -> None: # init script with open( os.path.join( - pkg_resources.resource_filename("tutormfe", "templates"), - "mfe", - "tasks", - "lms", - "init", + str( + importlib_resources.files("tutormfe") + / "templates" + / "mfe" + / "tasks" + / "lms" + / "init" + ) ), encoding="utf-8", ) as task_file: @@ -248,7 +251,7 @@ def _build_3rd_party_dev_mfes_on_launch( # Boilerplate code # Add the "templates" folder as a template root tutor_hooks.Filters.ENV_TEMPLATE_ROOTS.add_item( - pkg_resources.resource_filename("tutormfe", "templates") + str(importlib_resources.files("tutormfe") / "templates") ) # Render the "build" and "apps" folders tutor_hooks.Filters.ENV_TEMPLATE_TARGETS.add_items( @@ -258,12 +261,7 @@ def _build_3rd_party_dev_mfes_on_launch( ], ) # Load patches from files -for path in glob( - os.path.join( - pkg_resources.resource_filename("tutormfe", "patches"), - "*", - ) -): +for path in glob(str(importlib_resources.files("tutormfe") / "patches" / "*")): with open(path, encoding="utf-8") as patch_file: # Here we force tutor-mfe lms patches to be loaded first, thus ensuring when operators override # MFE_CONFIG and/or MFE_CONFIG_OVERRIDES, their patches will be loaded after this plugin's From d3dd838e233b8e4a8cfd099d1fee585b28ed4d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Tue, 20 Feb 2024 15:15:40 +0100 Subject: [PATCH 5/6] ci: remove now useless OPENEDX_RELEASE variable --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7795af78..6ec2e55e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,6 @@ variables: TUTOR_PLUGIN: mfe TUTOR_IMAGES: mfe authn-dev account-dev communications-dev course-authoring-dev discussions-dev gradebook-dev learner-dashboard-dev learning-dev ora-grading-dev profile-dev TUTOR_PYPI_PACKAGE: tutor-mfe - OPENEDX_RELEASE: palm GITHUB_REPO: overhangio/tutor-mfe include: From fbf84be7220d5f3fc964e0d03d5662c18ee417de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Tue, 5 Mar 2024 11:51:51 +0500 Subject: [PATCH 6/6] ci: don't even try to auto-add PRs to github project Auto-adding PRs to the Github project is not working because the github-token is not available there. --- .github/workflows/auto-add-to-project.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/auto-add-to-project.yml b/.github/workflows/auto-add-to-project.yml index d4ab7a42..7dadeb66 100644 --- a/.github/workflows/auto-add-to-project.yml +++ b/.github/workflows/auto-add-to-project.yml @@ -1,9 +1,6 @@ -name: Auto Add Issues and Pull Requests to Project +name: Auto Add Issues to Project on: - pull_request: - types: - - opened issues: types: - opened