Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Overhang.IO committed Mar 5, 2024
2 parents d45e4aa + fbf84be commit d985d60
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
5 changes: 1 addition & 4 deletions .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
Expand Down
3 changes: 1 addition & 2 deletions .gitlab-ci.yml
@@ -1,8 +1,7 @@
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

include:
Expand Down
1 change: 1 addition & 0 deletions 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)
@@ -0,0 +1 @@
[Bugfix] Make sure course-authoring mfe is present in MFE_APPS before applying cms-development-settings. (by @Danyal-Faheem)
@@ -0,0 +1 @@
-[Bugfix] Added the learner-dashboard-dev image to the gitlab ci. (by @Danyal-Faheem)
2 changes: 2 additions & 0 deletions 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 %}
26 changes: 12 additions & 14 deletions tutormfe/plugin.py
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit d985d60

Please sign in to comment.