Skip to content

Commit

Permalink
Merge branch 'master' into ttqureshi/test-lti-block
Browse files Browse the repository at this point in the history
  • Loading branch information
ttqureshi authored Dec 12, 2024
2 parents 8343717 + f358ef3 commit 1cd0059
Show file tree
Hide file tree
Showing 96 changed files with 2,003 additions and 3,513 deletions.
2 changes: 0 additions & 2 deletions .annotation_safe_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ workflow.AssessmentWorkflowStep:
# Via edx-celeryutils
celery_utils.ChordData:
".. no_pii:": "No PII"
celery_utils.FailedTask:
".. no_pii:": "No PII"

# Via completion XBlock
completion.BlockCompletion:
Expand Down
14 changes: 13 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,21 @@ test_root/staticfiles
common/static/xmodule


# Symlinks into xmodule/js
# Various intra-repo symlinks that we've added over the years to duct-tape the JS build together.
# Ignore them so that we're not double-counting these violations.
cms/static/edx-ui-toolkit
cms/static/xmodule_js
lms/static/common
lms/static/course_bookmarks
lms/static/course_experience
lms/static/course_search
lms/static/discussion
lms/static/edx-ui-toolkit
lms/static/learner_profile
lms/static/support
lms/static/teams
lms/static/xmodule_js
xmodule/js/common_static


# Mako templates that generate .js files
Expand Down
14 changes: 7 additions & 7 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 Expand Up @@ -64,13 +64,13 @@ jobs:
make base-requirements
- uses: c-hive/gha-npm-cache@v1

- name: Install npm
run: npm ci

- name: Run JS Tests
env:
TEST_SUITE: js-unit
SCRIPT_TO_RUN: ./scripts/generic-ci-tests.sh
run: |
npm install -g jest
xvfb-run --auto-servernum ./scripts/all-tests.sh
npm run test
- name: Save Job Artifacts
uses: actions/upload-artifact@v4
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,29 @@ jobs:
PIP_SRC: ${{ runner.temp }}
run: |
make test-requirements
- name: Install npm
env:
PIP_SRC: ${{ runner.temp }}
run: npm ci

- name: Install python packages
env:
PIP_SRC: ${{ runner.temp }}
run: |
pip install -e .
- name: Run Quality Tests
env:
TEST_SUITE: quality
SCRIPT_TO_RUN: ./scripts/generic-ci-tests.sh
PIP_SRC: ${{ runner.temp }}
TARGET_BRANCH: ${{ github.base_ref }}
run: |
./scripts/all-tests.sh
make pycodestyle
npm run lint
make xsslint
make pii_check
make check_keywords
- name: Save Job Artifacts
if: always()
uses: actions/upload-artifact@v4
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
2 changes: 1 addition & 1 deletion .pii_annotations.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source_path: ./
report_path: pii_report
safelist_path: .annotation_safe_list.yml
coverage_target: 94.5
coverage_target: 85.3
# See OEP-30 for more information on these values and what they mean:
# https://open-edx-proposals.readthedocs.io/en/latest/oep-0030-arch-pii-markup-and-auditing.html#docstring-annotations
annotations:
Expand Down
5 changes: 0 additions & 5 deletions .stylelintignore

This file was deleted.

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
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,37 @@ migrate: migrate-lms migrate-cms
# Part of https://github.com/openedx/wg-developer-experience/issues/136
ubuntu-requirements: ## Install ubuntu 22.04 system packages needed for `pip install` to work on ubuntu.
sudo apt install libmysqlclient-dev libxmlsec1-dev

xsslint: ## check xss for quality issuest
python scripts/xsslint/xss_linter.py \
--rule-totals \
--config=scripts.xsslint_config \
--thresholds=scripts/xsslint_thresholds.json

pycodestyle: ## check python files for quality issues
pycodestyle .

## Re-enable --lint flag when this issue https://github.com/openedx/edx-platform/issues/35775 is resolved
pii_check: ## check django models for pii annotations
DJANGO_SETTINGS_MODULE=cms.envs.test \
code_annotations django_find_annotations \
--config_file .pii_annotations.yml \
--app_name cms \
--coverage \
--lint

DJANGO_SETTINGS_MODULE=lms.envs.test \
code_annotations django_find_annotations \
--config_file .pii_annotations.yml \
--app_name lms \
--coverage \
--lint

check_keywords: ## check django models for reserve keywords
DJANGO_SETTINGS_MODULE=cms.envs.test \
python manage.py cms check_reserved_keywords \
--override_file db_keyword_overrides.yml

DJANGO_SETTINGS_MODULE=lms.envs.test \
python manage.py lms check_reserved_keywords \
--override_file db_keyword_overrides.yml
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
Loading

0 comments on commit 1cd0059

Please sign in to comment.