diff --git a/.github/actions/unit-tests/action.yml b/.github/actions/unit-tests/action.yml index eb7fee0a6b..7d217cd26f 100644 --- a/.github/actions/unit-tests/action.yml +++ b/.github/actions/unit-tests/action.yml @@ -1,5 +1,5 @@ -name: 'Run unit tests' -description: 'shared steps to run unit tests on both Github hosted and self hosted runners.' +name: "Run unit tests" +description: "shared steps to run unit tests on both Github hosted and self hosted runners." runs: using: "composite" steps: diff --git a/.github/actions/verify-tests-count/action.yml b/.github/actions/verify-tests-count/action.yml index 11afb73671..d299f1ca11 100644 --- a/.github/actions/verify-tests-count/action.yml +++ b/.github/actions/verify-tests-count/action.yml @@ -1,5 +1,5 @@ -name: 'Verify unit tests count' -description: 'shared steps to verify unit tests count on both Github hosted and self hosted runners.' +name: "Verify unit tests count" +description: "shared steps to verify unit tests count on both Github hosted and self hosted runners." runs: using: "composite" steps: @@ -15,14 +15,12 @@ runs: echo "cms_unit_test_paths=$(python scripts/gha_unit_tests_collector.py --cms-only)" >> $GITHUB_ENV echo "lms_unit_test_paths=$(python scripts/gha_unit_tests_collector.py --lms-only)" >> $GITHUB_ENV - - name: collect tests from GHA unit test shards shell: bash run: | echo "cms_unit_tests_count=$(pytest --disable-warnings --collect-only --ds=cms.envs.test ${{ env.cms_unit_test_paths }} -q | head -n -2 | wc -l)" >> $GITHUB_ENV echo "lms_unit_tests_count=$(pytest --disable-warnings --collect-only --ds=lms.envs.test ${{ env.lms_unit_test_paths }} -q | head -n -2 | wc -l)" >> $GITHUB_ENV - - name: add unit tests count shell: bash run: | diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 06be5a978f..4a01922edd 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -21,6 +21,7 @@ Design decisions and their rationales should be documented in the repo (docstrin linked here. Useful information to include: + - Which edX user roles will this change impact? Common user roles are "Learner", "Course Author", "Developer", and "Operator". - Include screenshots for changes to the UI (ideally, both "before" and "after" screenshots, if applicable). @@ -43,6 +44,7 @@ Please provide detailed step-by-step instructions for testing this change. ## Other information Include anything else that will help reviewers and consumers understand the change. + - Does this change depend on other changes elsewhere? - Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility. - If your [database migration](https://openedx.atlassian.net/wiki/spaces/AC/pages/23003228/Everything+About+Database+Migrations) can't be rolled back easily. diff --git a/.github/workflows/add-remove-label-on-comment.yml b/.github/workflows/add-remove-label-on-comment.yml index 0f369db7d2..a658064f09 100644 --- a/.github/workflows/add-remove-label-on-comment.yml +++ b/.github/workflows/add-remove-label-on-comment.yml @@ -17,4 +17,3 @@ on: jobs: add_remove_labels: uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master - diff --git a/.github/workflows/check-consistent-dependencies.yml b/.github/workflows/check-consistent-dependencies.yml index 1c57fc6f6b..0e4595a9d0 100644 --- a/.github/workflows/check-consistent-dependencies.yml +++ b/.github/workflows/check-consistent-dependencies.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/setup-python@v5 if: ${{ env.RELEVANT == 'true' }} with: - python-version: '3.8' + python-version: "3.8" - name: "Recompile requirements" if: ${{ env.RELEVANT == 'true' }} diff --git a/.github/workflows/check-for-tutorial-prs.yml b/.github/workflows/check-for-tutorial-prs.yml index da7995e0c4..dc8d8557e5 100644 --- a/.github/workflows/check-for-tutorial-prs.yml +++ b/.github/workflows/check-for-tutorial-prs.yml @@ -14,7 +14,7 @@ on: pull_request: types: [opened] paths: - - 'lms/templates/dashboard.html' + - "lms/templates/dashboard.html" jobs: # Provide helpful bot comment @@ -32,4 +32,4 @@ jobs: Thank you for your pull request! Congratulations on completing the Open edX tutorial! A team member will be by to take a look shortly. To those watching community pull requests: No need to worry about this one, a tCRIL team member will be taking care of it. For this PR's author: If this is a PR that is NOT coming from the Open edX tutorial, please comment and let us know to disregard this message. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-static-analysis.yml b/.github/workflows/ci-static-analysis.yml index e1c663c083..0ae7363601 100644 --- a/.github/workflows/ci-static-analysis.yml +++ b/.github/workflows/ci-static-analysis.yml @@ -9,8 +9,8 @@ jobs: strategy: matrix: python-version: - - '3.11' - os: ['ubuntu-20.04'] + - "3.11" + os: ["ubuntu-20.04"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/compile-python-requirements.yml b/.github/workflows/compile-python-requirements.yml index 85d0eb0882..0ff99b9c68 100644 --- a/.github/workflows/compile-python-requirements.yml +++ b/.github/workflows/compile-python-requirements.yml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: branch: - description: 'Target branch to create requirements PR against' + description: "Target branch to create requirements PR against" required: true - default: 'master' + default: "master" type: string defaults: diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b0af217e6e..98a80f1da3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -9,8 +9,8 @@ jobs: # See also https://docs.docker.com/docker-hub/builds/ push: runs-on: ubuntu-latest - if: github.event_name == 'push' - + if: github.event_name == 'push' + strategy: matrix: variant: @@ -32,12 +32,11 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Build and push lms base docker image env: DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - run : make docker_tag_build_push_${{matrix.variant}} - \ No newline at end of file + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + run: make docker_tag_build_push_${{matrix.variant}} diff --git a/.github/workflows/js-tests.yml b/.github/workflows/js-tests.yml index 37d825d9ab..243f56262a 100644 --- a/.github/workflows/js-tests.yml +++ b/.github/workflows/js-tests.yml @@ -12,74 +12,73 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04 ] - node-version: [ 18 ] + os: [ubuntu-20.04] + node-version: [18] python-version: - - '3.11' + - "3.11" steps: + - uses: actions/checkout@v4 + - name: Fetch master to compare coverage + run: git fetch --depth=1 origin master - - uses: actions/checkout@v4 - - name: Fetch master to compare coverage - run: git fetch --depth=1 origin master + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} + - name: Setup npm + run: npm i -g npm@10.5.x - - name: Setup npm - run: npm i -g npm@10.5.x + - name: Install Firefox 123.0 + run: | + sudo apt-get purge firefox + wget "https://ftp.mozilla.org/pub/firefox/releases/123.0/linux-x86_64/en-US/firefox-123.0.tar.bz2" + tar -xjf firefox-123.0.tar.bz2 + sudo mv firefox /opt/firefox + sudo ln -s /opt/firefox/firefox /usr/bin/firefox - - name: Install Firefox 123.0 - run: | - sudo apt-get purge firefox - wget "https://ftp.mozilla.org/pub/firefox/releases/123.0/linux-x86_64/en-US/firefox-123.0.tar.bz2" - tar -xjf firefox-123.0.tar.bz2 - sudo mv firefox /opt/firefox - sudo ln -s /opt/firefox/firefox /usr/bin/firefox + - name: Install Required System Packages + run: sudo apt-get update && sudo apt-get install libxmlsec1-dev ubuntu-restricted-extras xvfb - - name: Install Required System Packages - run: sudo apt-get update && sudo apt-get install libxmlsec1-dev ubuntu-restricted-extras xvfb + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Get pip cache dir + id: pip-cache-dir + run: | + echo "::set-output name=dir::$(pip cache dir)" - - name: Get pip cache dir - id: pip-cache-dir - run: | - echo "::set-output name=dir::$(pip cache dir)" + - name: Cache pip dependencies + id: cache-dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.pip-cache-dir.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/base.txt') }} + restore-keys: ${{ runner.os }}-pip- - - name: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.pip-cache-dir.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/base.txt') }} - restore-keys: ${{ runner.os }}-pip- + - name: Install Required Python Dependencies + run: | + make base-requirements - - name: Install Required Python Dependencies - run: | - make base-requirements + - uses: c-hive/gha-npm-cache@v1 + - 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 - - uses: c-hive/gha-npm-cache@v1 - - 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 - - - name: Save Job Artifacts - uses: actions/upload-artifact@v4 - with: - name: Build-Artifacts - path: | - reports/**/* - test_root/log/*.png - test_root/log/*.log - **/TEST-*.xml - overwrite: true + - name: Save Job Artifacts + uses: actions/upload-artifact@v4 + with: + name: Build-Artifacts + path: | + reports/**/* + test_root/log/*.png + test_root/log/*.log + **/TEST-*.xml + overwrite: true diff --git a/.github/workflows/lint-imports.yml b/.github/workflows/lint-imports.yml index f9ae712cfd..24f241016b 100644 --- a/.github/workflows/lint-imports.yml +++ b/.github/workflows/lint-imports.yml @@ -7,7 +7,6 @@ on: - master jobs: - lint-imports: name: Lint Python Imports runs-on: ubuntu-20.04 @@ -19,7 +18,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - name: Install system requirements run: sudo apt update && sudo apt install -y libxmlsec1-dev diff --git a/.github/workflows/lockfileversion-check.yml b/.github/workflows/lockfileversion-check.yml index 916dcb40d2..736f1f98de 100644 --- a/.github/workflows/lockfileversion-check.yml +++ b/.github/workflows/lockfileversion-check.yml @@ -5,7 +5,7 @@ name: Lockfile Version check on: push: branches: - - master + - master pull_request: jobs: diff --git a/.github/workflows/migrations-check.yml b/.github/workflows/migrations-check.yml index 75d9fde9fd..45919c8f65 100644 --- a/.github/workflows/migrations-check.yml +++ b/.github/workflows/migrations-check.yml @@ -13,9 +13,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04 ] + os: [ubuntu-20.04] python-version: - - '3.11' + - "3.11" # 'pinned' is used to install the latest patch version of Django # within the global constraint i.e. Django==4.2.8 in current case # because we have global constraint of Django<4.2 @@ -50,73 +50,73 @@ jobs: --health-timeout 5s --health-retries 3 steps: - - name: Setup mongodb user - run: | - mongosh edxapp --eval ' - db.createUser( - { - user: "edxapp", - pwd: "password", - roles: [ - { role: "readWrite", db: "edxapp" }, - ] - } - ); - ' + - name: Setup mongodb user + run: | + mongosh edxapp --eval ' + db.createUser( + { + user: "edxapp", + pwd: "password", + roles: [ + { role: "readWrite", db: "edxapp" }, + ] + } + ); + ' - - name: Verify mongo and mysql db credentials - run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp - mongosh --host 127.0.0.1 --username edxapp --password password --eval 'use edxapp; db.adminCommand("ping");' edxapp + - name: Verify mongo and mysql db credentials + run: | + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp + mongosh --host 127.0.0.1 --username edxapp --password password --eval 'use edxapp; db.adminCommand("ping");' edxapp - - name: Checkout repo - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - - name: Install system Packages - run: | - sudo apt-get update - make ubuntu-requirements + - name: Install system Packages + run: | + sudo apt-get update + make ubuntu-requirements - - name: Get pip cache dir - id: pip-cache-dir - run: | - echo "::set-output name=dir::$(pip cache dir)" + - name: Get pip cache dir + id: pip-cache-dir + run: | + echo "::set-output name=dir::$(pip cache dir)" - - name: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.pip-cache-dir.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }} - restore-keys: ${{ runner.os }}-pip- + - name: Cache pip dependencies + id: cache-dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.pip-cache-dir.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }} + restore-keys: ${{ runner.os }}-pip- - - name: Install Python dependencies - run: | - make dev-requirements - if [[ "${{ matrix.django-version }}" != "pinned" ]]; then - pip install "django~=${{ matrix.django-version }}.0" - pip check # fail if this test-reqs/Django combination is broken - fi + - name: Install Python dependencies + run: | + make dev-requirements + if [[ "${{ matrix.django-version }}" != "pinned" ]]; then + pip install "django~=${{ matrix.django-version }}.0" + pip check # fail if this test-reqs/Django combination is broken + fi - - name: list installed package versions - run: | - sudo pip freeze + - name: list installed package versions + run: | + sudo pip freeze - - name: Run Tests - env: - LMS_CFG: lms/envs/minimal.yml - # This is from the LMS dir on purpose since we don't need anything different for the CMS yet. - STUDIO_CFG: lms/envs/minimal.yml - run: | - echo "Running the LMS migrations." - ./manage.py lms migrate - echo "Running the CMS migrations." - ./manage.py cms migrate + - name: Run Tests + env: + LMS_CFG: lms/envs/minimal.yml + # This is from the LMS dir on purpose since we don't need anything different for the CMS yet. + STUDIO_CFG: lms/envs/minimal.yml + run: | + echo "Running the LMS migrations." + ./manage.py lms migrate + echo "Running the CMS migrations." + ./manage.py cms migrate # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why diff --git a/.github/workflows/publish-ci-docker-image.yml b/.github/workflows/publish-ci-docker-image.yml index d97b205cfa..0a9f50f6da 100644 --- a/.github/workflows/publish-ci-docker-image.yml +++ b/.github/workflows/publish-ci-docker-image.yml @@ -41,4 +41,3 @@ jobs: run: | docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f scripts/ci-runner.Dockerfile . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml index d2264297a0..b9e2250cb1 100644 --- a/.github/workflows/quality-checks.yml +++ b/.github/workflows/quality-checks.yml @@ -13,71 +13,70 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04 ] + os: [ubuntu-20.04] python-version: - - '3.11' - node-version: [ 18 ] + - "3.11" + node-version: [18] steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 - - uses: actions/checkout@v4 - with: - fetch-depth: 2 + - name: Fetch base branch for comparison + run: git fetch --depth=1 origin ${{ github.base_ref }} - - name: Fetch base branch for comparison - run: git fetch --depth=1 origin ${{ github.base_ref }} + - name: Install Required System Packages + run: sudo apt-get update && sudo apt-get install libxmlsec1-dev - - name: Install Required System Packages - run: sudo apt-get update && sudo apt-get install libxmlsec1-dev + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} + - name: Setup npm + run: npm i -g npm@8.5.x - - name: Setup npm - run: npm i -g npm@8.5.x + - name: Get pip cache dir + id: pip-cache-dir + run: | + echo "::set-output name=dir::$(pip cache dir)" - - name: Get pip cache dir - id: pip-cache-dir - run: | - echo "::set-output name=dir::$(pip cache dir)" + - name: Cache pip dependencies + id: cache-dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.pip-cache-dir.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/testing.txt') }} + restore-keys: ${{ runner.os }}-pip- - - name: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.pip-cache-dir.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/testing.txt') }} - restore-keys: ${{ runner.os }}-pip- + - name: Install Required Python Dependencies + env: + PIP_SRC: ${{ runner.temp }} + run: | + make test-requirements - - name: Install Required Python Dependencies - env: - PIP_SRC: ${{ runner.temp }} - run: | - make test-requirements + - 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 - - 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 - - - name: Save Job Artifacts - if: always() - uses: actions/upload-artifact@v4 - with: - name: Build-Artifacts - path: | - **/reports/**/* - test_root/log/**/*.log - *.log - overwrite: true + - name: Save Job Artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: Build-Artifacts + path: | + **/reports/**/* + test_root/log/**/*.log + *.log + overwrite: true diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index 4f01f11122..7f2b4925af 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -17,9 +17,9 @@ jobs: runs-on: "${{ matrix.os }}" strategy: matrix: - os: [ "ubuntu-20.04" ] + os: ["ubuntu-20.04"] python-version: - - '3.11' + - "3.11" steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 704ff778a1..2e5b04bcc2 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -9,7 +9,7 @@ on: pull_request: push: branches: - - master + - master permissions: contents: read diff --git a/.github/workflows/static-assets-check.yml b/.github/workflows/static-assets-check.yml index 09307145be..e6cb1a3b44 100644 --- a/.github/workflows/static-assets-check.yml +++ b/.github/workflows/static-assets-check.yml @@ -12,11 +12,11 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04 ] + os: [ubuntu-20.04] python-version: - - '3.11' - node-version: [ 18 ] - npm-version: [ 10.5.x ] + - "3.11" + node-version: [18] + npm-version: [10.5.x] mongo-version: - "7.0" @@ -34,73 +34,73 @@ jobs: --health-retries 3 steps: - - name: Checkout repo - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - - name: Install system Packages - run: | - sudo apt-get update - sudo apt-get install libxmlsec1-dev pkg-config + - name: Install system Packages + run: | + sudo apt-get update + sudo apt-get install libxmlsec1-dev pkg-config - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} - - name: Setup npm - run: npm i -g npm@${{ matrix.npm-version }} + - name: Setup npm + run: npm i -g npm@${{ matrix.npm-version }} - - name: Get pip cache dir - id: pip-cache-dir - run: | - echo "::set-output name=dir::$(pip cache dir)" + - name: Get pip cache dir + id: pip-cache-dir + run: | + echo "::set-output name=dir::$(pip cache dir)" - - name: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.pip-cache-dir.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }} - restore-keys: ${{ runner.os }}-pip- + - name: Cache pip dependencies + id: cache-dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.pip-cache-dir.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }} + restore-keys: ${{ runner.os }}-pip- - - name: Install Limited Python Deps for Build - run: | - pip install -r requirements/edx/assets.txt + - name: Install Limited Python Deps for Build + run: | + pip install -r requirements/edx/assets.txt - - name: Initiate Mongo DB Service - run: sudo systemctl start mongod + - name: Initiate Mongo DB Service + run: sudo systemctl start mongod - - name: Add node_modules bin to $Path - run: echo $GITHUB_WORKSPACE/node_modules/.bin >> $GITHUB_PATH + - name: Add node_modules bin to $Path + run: echo $GITHUB_WORKSPACE/node_modules/.bin >> $GITHUB_PATH - - name: Check Dev Assets Build - env: - COMPREHENSIVE_THEMES_DIR: ./themes - run: | - npm clean-install --dev - npm run build-dev + - name: Check Dev Assets Build + env: + COMPREHENSIVE_THEMES_DIR: ./themes + run: | + npm clean-install --dev + npm run build-dev - - name: Check Prod Assets Build - env: - COMPREHENSIVE_THEMES_DIR: ./themes - run: | - npm clean-install - npm run build + - name: Check Prod Assets Build + env: + COMPREHENSIVE_THEMES_DIR: ./themes + run: | + npm clean-install + npm run build - - name: Install Full Python Deps for Collection - run: | - pip install -r requirements/edx/base.txt -e . + - name: Install Full Python Deps for Collection + run: | + pip install -r requirements/edx/base.txt -e . - - name: Check Assets Collection - env: - LMS_CFG: lms/envs/minimal.yml - CMS_CFG: lms/envs/minimal.yml - DJANGO_SETTINGS_MODULE: lms.envs.production - run: | - ./manage.py lms collectstatic --noinput - ./manage.py cms collectstatic --noinput + - name: Check Assets Collection + env: + LMS_CFG: lms/envs/minimal.yml + CMS_CFG: lms/envs/minimal.yml + DJANGO_SETTINGS_MODULE: lms.envs.production + run: | + ./manage.py lms collectstatic --noinput + ./manage.py cms collectstatic --noinput diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 7df346e658..5eb1e468dd 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -133,7 +133,7 @@ jobs: success: name: Unit tests successful runs-on: ubuntu-20.04 - needs: [ run-tests ] + needs: [run-tests] steps: - name: Decide whether the needed jobs succeeded or failed # uses: re-actors/alls-green@v1.2.1 @@ -143,7 +143,7 @@ jobs: compile-warnings-report: runs-on: ubuntu-20.04 - needs: [ run-tests ] + needs: [run-tests] steps: - uses: actions/checkout@v4 - name: collect pytest warnings files @@ -172,7 +172,7 @@ jobs: coverage: if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false)) runs-on: ubuntu-20.04 - needs: [ run-tests ] + needs: [run-tests] strategy: matrix: python-version: diff --git a/.github/workflows/units-test-scripts-structures-pruning.yml b/.github/workflows/units-test-scripts-structures-pruning.yml index 28476ecefd..cbf9da8f5c 100644 --- a/.github/workflows/units-test-scripts-structures-pruning.yml +++ b/.github/workflows/units-test-scripts-structures-pruning.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: python-version: - - '3.12' + - "3.12" steps: - name: Checkout code diff --git a/.github/workflows/units-test-scripts-user-retirement.yml b/.github/workflows/units-test-scripts-user-retirement.yml index a0f1d466c6..f1b2b2c539 100644 --- a/.github/workflows/units-test-scripts-user-retirement.yml +++ b/.github/workflows/units-test-scripts-user-retirement.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: python-version: - - '3.12' + - "3.12" steps: - name: Checkout code diff --git a/.github/workflows/update-geolite-database.yml b/.github/workflows/update-geolite-database.yml index 3289d31a22..08716b8ad9 100644 --- a/.github/workflows/update-geolite-database.yml +++ b/.github/workflows/update-geolite-database.yml @@ -6,18 +6,18 @@ on: workflow_dispatch: inputs: branch: - description: 'Target branch against which to create PR' + description: "Target branch against which to create PR" required: false - default: 'master' + default: "master" env: - MAXMIND_URL: 'https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${{ secrets.MAXMIND_LICENSE_KEY }}&suffix=tar.gz' - MAXMIND_SHA256_URL: 'https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${{ secrets.MAXMIND_LICENSE_KEY }}&suffix=tar.gz.sha256' - TAR_FILE_NAME: 'GeoLite2-Country.tar.gz' - TAR_SHA256_FILE_NAME: 'GeoLite2-Country.tar.gz.sha256' - TAR_UNZIPPED_ROOT_PATTERN: 'GeoLite2-Country_*' - DB_FILE: 'GeoLite2-Country.mmdb' - DB_DESTINATION_PATH: 'common/static/data/geoip' + MAXMIND_URL: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${{ secrets.MAXMIND_LICENSE_KEY }}&suffix=tar.gz" + MAXMIND_SHA256_URL: "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${{ secrets.MAXMIND_LICENSE_KEY }}&suffix=tar.gz.sha256" + TAR_FILE_NAME: "GeoLite2-Country.tar.gz" + TAR_SHA256_FILE_NAME: "GeoLite2-Country.tar.gz.sha256" + TAR_UNZIPPED_ROOT_PATTERN: "GeoLite2-Country_*" + DB_FILE: "GeoLite2-Country.mmdb" + DB_DESTINATION_PATH: "common/static/data/geoip" jobs: download-and-replace: diff --git a/.github/workflows/upgrade-one-python-dependency.yml b/.github/workflows/upgrade-one-python-dependency.yml index adb2d2742e..6ca5dfcb35 100644 --- a/.github/workflows/upgrade-one-python-dependency.yml +++ b/.github/workflows/upgrade-one-python-dependency.yml @@ -4,22 +4,22 @@ on: workflow_dispatch: inputs: branch: - description: 'Target branch to create requirements PR against' + description: "Target branch to create requirements PR against" required: true - default: 'master' + default: "master" type: string package: - description: 'Name of package to upgrade' + description: "Name of package to upgrade" required: true type: string version: - description: 'Version number to upgrade to in constraints.txt (only needed if pinned)' - default: '' + description: "Version number to upgrade to in constraints.txt (only needed if pinned)" + default: "" type: string change_desc: description: | Description of change, for commit message and PR. (What does the new version add or fix?) - default: '' + default: "" type: string defaults: diff --git a/.github/workflows/upgrade-python-requirements.yml b/.github/workflows/upgrade-python-requirements.yml index fcacf81929..ed6caf7590 100644 --- a/.github/workflows/upgrade-python-requirements.yml +++ b/.github/workflows/upgrade-python-requirements.yml @@ -2,26 +2,25 @@ name: Upgrade Requirements on: schedule: - - cron: "0 2 * * 2" + - cron: "0 2 * * 2" workflow_dispatch: - inputs: - branch: - description: 'Target branch to create requirements PR against' - required: true - default: 'master' + inputs: + branch: + description: "Target branch to create requirements PR against" + required: true + default: "master" jobs: call-upgrade-python-requirements-workflow: # Don't run the weekly upgrade job on forks -- it will send a weekly failure email. if: github.repository == 'openedx/edx-platform' || github.event_name != 'schedule' uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master with: - branch: ${{ github.event.inputs.branch }} - team_reviewers: "arbi-bom" - email_address: arbi-bom@edx.org - send_success_notification: false + branch: ${{ github.event.inputs.branch }} + team_reviewers: "arbi-bom" + email_address: arbi-bom@edx.org + send_success_notification: false secrets: - requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }} - requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }} - edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }} - edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }} - + requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }} + requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }} + edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }} + edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }} diff --git a/.github/workflows/verify-dunder-init.yml b/.github/workflows/verify-dunder-init.yml index e2a7d58cd9..611fc0afc6 100644 --- a/.github/workflows/verify-dunder-init.yml +++ b/.github/workflows/verify-dunder-init.yml @@ -6,21 +6,18 @@ on: - master jobs: - verify_dunder_init: - name: Verify __init__.py Files runs-on: ubuntu-20.04 steps: + - name: Check out branch + uses: actions/checkout@v4 - - name: Check out branch - uses: actions/checkout@v4 + - name: Ensure git is installed + run: | + sudo apt-get update && sudo apt-get install git - - name: Ensure git is installed - run: | - sudo apt-get update && sudo apt-get install git - - - name: Verify __init__.py files exist - run: | - scripts/verify-dunder-init.sh + - name: Verify __init__.py files exist + run: | + scripts/verify-dunder-init.sh