Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-ferdman authored Dec 9, 2024
2 parents b14b3d0 + 394a459 commit 97c9282
Show file tree
Hide file tree
Showing 136 changed files with 4,161 additions and 4,556 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ openedx/core/djangoapps/enrollments/ @openedx/2U-
openedx/core/djangoapps/heartbeat/
openedx/core/djangoapps/oauth_dispatch
openedx/core/djangoapps/user_api/ @openedx/2U-aperture
openedx/core/djangoapps/user_authn/ @openedx/2U-vanguards
openedx/core/djangoapps/user_authn/ @openedx/2U-infinity
openedx/core/djangoapps/verified_track_content/ @openedx/2u-infinity
openedx/features/course_experience/
xmodule/
Expand Down
6 changes: 5 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
// When adding an ignoreDep, please include a reason and a public link that we can use to follow up and ensure
// that the ignoreDep is removed.
// This can be done as a comment within the ignoreDeps list.
"ignoreDeps": [],
"ignoreDeps": [
// karma-spec-reporter>0.20.0 does not seem compatible with our super-old 2016 Karma version (0.13.22).
// Ticket link: None, as upgrading Karma does not strike as worth the benefit.
"karma-spec-reporter"
],
"timezone": "America/New_York",
"prConcurrentLimit": 3,
"enabledManagers": ["npm"]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18, 20]
node-version: [20]
python-version:
- "3.11"

Expand All @@ -28,7 +28,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Setup npm
run: npm i -g npm@10.5.x
run: npm i -g npm@10.7.x

- name: Install Firefox 123.0
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-assets-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
os: [ubuntu-24.04]
python-version:
- "3.11"
node-version: [18, 20]
npm-version: [10.5.x]
node-version: [20]
npm-version: [10.7.x]
mongo-version:
- "7.0"

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/unit-test-shards.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@
"cms/djangoapps/cms_user_tasks/",
"cms/djangoapps/course_creators/",
"cms/djangoapps/export_course_metadata/",
"cms/djangoapps/maintenance/",
"cms/djangoapps/models/",
"cms/djangoapps/pipeline_js/",
"cms/djangoapps/xblock_config/",
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
84 changes: 42 additions & 42 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,36 @@ RUN echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8"

# Setting up ppa deadsnakes to get python 3.11
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-add-repository -y ppa:deadsnakes/ppa
apt-get install -y software-properties-common && \
apt-add-repository -y ppa:deadsnakes/ppa

# Install requirements that are absolutely necessary
RUN apt-get update && \
apt-get -y dist-upgrade && \
apt-get -y install --no-install-recommends \
python3-pip \
python3.11 \
# python3-dev: required for building mysqlclient python package
python3.11-dev \
python3.11-venv \
libpython3.11 \
libpython3.11-stdlib \
libmysqlclient21 \
# libmysqlclient-dev: required for building mysqlclient python package
libmysqlclient-dev \
pkg-config \
libssl1.1 \
libxmlsec1-openssl \
# lynx: Required by https://github.com/openedx/edx-platform/blob/b489a4ecb122/openedx/core/lib/html_to_text.py#L16
lynx \
ntp \
git \
build-essential \
gettext \
gfortran \
graphviz \
locales \
swig \
python3-pip \
python3.11 \
# python3-dev: required for building mysqlclient python package
python3.11-dev \
python3.11-venv \
libpython3.11 \
libpython3.11-stdlib \
libmysqlclient21 \
# libmysqlclient-dev: required for building mysqlclient python package
libmysqlclient-dev \
pkg-config \
libssl1.1 \
libxmlsec1-openssl \
# lynx: Required by https://github.com/openedx/edx-platform/blob/b489a4ecb122/openedx/core/lib/html_to_text.py#L16
lynx \
ntp \
git \
build-essential \
gettext \
gfortran \
graphviz \
locales \
swig \
&& \
apt-get clean all && \
rm -rf /var/lib/apt/*
Expand All @@ -93,19 +93,19 @@ FROM minimal-system as builder-production

RUN apt-get update && \
apt-get -y install --no-install-recommends \
curl \
libssl-dev \
libffi-dev \
libfreetype6-dev \
libgeos-dev \
libgraphviz-dev \
libjpeg8-dev \
liblapack-dev \
libpng-dev \
libsqlite3-dev \
libxml2-dev \
libxmlsec1-dev \
libxslt1-dev
curl \
libssl-dev \
libffi-dev \
libfreetype6-dev \
libgeos-dev \
libgraphviz-dev \
libjpeg8-dev \
liblapack-dev \
libpng-dev \
libsqlite3-dev \
libxml2-dev \
libxmlsec1-dev \
libxslt1-dev

# Setup python virtual environment
# It is already 'activated' because $VIRTUAL_ENV/bin was put on $PATH
Expand All @@ -118,8 +118,8 @@ RUN pip install -r requirements/pip.txt
RUN pip install -r requirements/edx/base.txt

# Install node and npm
RUN nodeenv /edx/app/edxapp/nodeenv --node=18.19.0 --prebuilt
RUN npm install -g npm@10.5.x
RUN nodeenv /edx/app/edxapp/nodeenv --node=20.15.1 --prebuilt
RUN npm install -g npm@10.7.x

# This script is used by an npm post-install hook.
# We copy it into the image now so that it will be available when we run `npm install` in the next step.
Expand Down Expand Up @@ -178,8 +178,8 @@ FROM base as development

RUN apt-get update && \
apt-get -y install --no-install-recommends \
# wget is used in Makefile for common_constraints.txt
wget \
# wget is used in Makefile for common_constraints.txt
wget \
&& \
apt-get clean all && \
rm -rf /var/lib/apt/*
Expand Down
13 changes: 11 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ System Dependencies
-------------------

OS:
* Ubuntu 20.04

* Ubuntu 22.04

* Ubuntu 24.04

Interperters/Tools:

* Python 3.11
Expand Down Expand Up @@ -107,6 +107,15 @@ Language Packages:

Some Python packages have system dependencies. For example, installing these packages on Debian or Ubuntu will require first running ``sudo apt install python3-dev default-libmysqlclient-dev build-essential pkg-config`` to satisfy the requirements of the ``mysqlclient`` Python package.

Codejail Setup
--------------

As a part of the baremetal setup, you will need to configure your system to
work properly with codejail. See the `codejail installation steps`_ for more
details.

.. _codejail installation steps: https://github.com/openedx/codejail?tab=readme-ov-file#installation

Build Steps
-----------

Expand Down
5 changes: 5 additions & 0 deletions cms/djangoapps/contentstore/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import urllib
from lxml import etree
from mimetypes import guess_type
import re

from attrs import frozen, Factory
from django.conf import settings
Expand Down Expand Up @@ -447,6 +448,10 @@ def _import_xml_node_to_parent(
temp_xblock = xblock_class.parse_xml(node_without_children, runtime, keys)
child_nodes = list(node)

if issubclass(xblock_class, XmlMixin) and "x-is-pointer-node" in getattr(temp_xblock, "data", ""):
# Undo the "pointer node" hack if needed (e.g. for capa problems)
temp_xblock.data = re.sub(r'([^>]+) x-is-pointer-node="no"', r'\1', temp_xblock.data, count=1)

# Restore the original id_generator
runtime.id_generator = original_id_generator

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class CourseWaffleFlagsSerializer(serializers.Serializer):
use_new_certificates_page = serializers.SerializerMethodField()
use_new_textbooks_page = serializers.SerializerMethodField()
use_new_group_configurations_page = serializers.SerializerMethodField()
enable_course_optimizer = serializers.SerializerMethodField()

def get_course_key(self):
"""
Expand Down Expand Up @@ -144,3 +145,10 @@ def get_use_new_group_configurations_page(self, obj):
"""
course_key = self.get_course_key()
return toggles.use_new_group_configurations_page(course_key)

def get_enable_course_optimizer(self, obj):
"""
Method to get the enable_course_optimizer waffle flag
"""
course_key = self.get_course_key()
return toggles.enable_course_optimizer(course_key)
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class StudioHomeSerializer(serializers.Serializer):
request_course_creator_url = serializers.CharField()
rerun_creator_status = serializers.BooleanField()
show_new_library_button = serializers.BooleanField()
show_new_library_v2_button = serializers.BooleanField()
split_studio_home = serializers.BooleanField()
studio_name = serializers.CharField()
studio_short_name = serializers.CharField()
Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/contentstore/rest_api/v1/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def get(self, request: Request):
"request_course_creator_url": "/request_course_creator",
"rerun_creator_status": true,
"show_new_library_button": true,
"show_new_library_v2_button": true,
"split_studio_home": false,
"studio_name": "Studio",
"studio_short_name": "Studio",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class CourseWaffleFlagsViewTest(CourseTestCase):
"use_new_group_configurations_page",
]

other_expected_waffle_flags = ["enable_course_optimizer"]

def setUp(self):
"""
Set up test data and state before each test method.
Expand All @@ -46,6 +48,18 @@ def setUp(self):
super().setUp()
self.url = reverse("cms.djangoapps.contentstore:v1:course_waffle_flags")
self.create_waffle_flags(self.course_waffle_flags)
self.create_custom_waffle_flags()

def create_custom_waffle_flags(self, enabled=True):
"""
Helper method to create waffle flags that are not part of `course_waffle_flags` and have
a different format.
"""
WaffleFlagCourseOverrideModel.objects.create(
waffle_flag="contentstore.enable_course_optimizer",
course_id=self.course.id,
enabled=enabled,
)

def create_waffle_flags(self, flags, enabled=True):
"""
Expand All @@ -72,7 +86,10 @@ def expected_response(self, enabled=False):
Returns:
dict: A dictionary with each flag set to the value of `enabled`.
"""
return {flag: enabled for flag in self.course_waffle_flags}
res = {flag: enabled for flag in self.course_waffle_flags}
for flag in self.other_expected_waffle_flags:
res[flag] = enabled
return res

def test_get_course_waffle_flags_with_course_id(self):
"""
Expand Down
Loading

0 comments on commit 97c9282

Please sign in to comment.