diff --git a/.github/workflows/add-depr-ticket-to-depr-board.yml b/.github/workflows/add-depr-ticket-to-depr-board.yml deleted file mode 100644 index 250e394abc11..000000000000 --- a/.github/workflows/add-depr-ticket-to-depr-board.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Run the workflow that adds new tickets that are either: -# - labelled "DEPR" -# - title starts with "[DEPR]" -# - body starts with "Proposal Date" (this is the first template field) -# to the org-wide DEPR project board - -name: Add newly created DEPR issues to the DEPR project board - -on: - issues: - types: [opened] - -jobs: - routeissue: - uses: openedx/.github/.github/workflows/add-depr-ticket-to-depr-board.yml@master - secrets: - GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }} - GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }} - SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }} diff --git a/.github/workflows/add-remove-label-on-comment.yml b/.github/workflows/add-remove-label-on-comment.yml deleted file mode 100644 index 0f369db7d293..000000000000 --- a/.github/workflows/add-remove-label-on-comment.yml +++ /dev/null @@ -1,20 +0,0 @@ -# This workflow runs when a comment is made on the ticket -# If the comment starts with "label: " it tries to apply -# the label indicated in rest of comment. -# If the comment starts with "remove label: ", it tries -# to remove the indicated label. -# Note: Labels are allowed to have spaces and this script does -# not parse spaces (as often a space is legitimate), so the command -# "label: really long lots of words label" will apply the -# label "really long lots of words label" - -name: Allows for the adding and removing of labels via comment - -on: - issue_comment: - types: [created] - -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 deleted file mode 100644 index 51a4d5f24fe2..000000000000 --- a/.github/workflows/check-consistent-dependencies.yml +++ /dev/null @@ -1,83 +0,0 @@ -# Rejects PR if requirements files are inconsistent. -# -# This will produce a failing check for any PR that does not produce a -# clean run of `make compile-requirements` on Linux. - -name: Consistent Python dependencies - -on: - pull_request: - -defaults: - run: - shell: bash # strict bash - -jobs: - check-requirements: - name: Compile requirements - runs-on: ubuntu-22.04 - - steps: - # Only run remaining steps if there are changes to requirements/** - - name: "Decide whether to short-circuit" - env: - GH_TOKEN: "${{ github.token }}" - PR_URL: "${{ github.event.pull_request.html_url }}" - run: | - paths=$(gh pr diff "$PR_URL" --name-only) - echo $'Paths touched in PR:\n'"$paths" - - # The ^"? is because git may quote weird file paths - matched="$(echo "$paths" | grep -P '^"?((requirements/)|(scripts/.*?/requirements/))' || true)" - echo $'Relevant paths:\n'"$matched" - if [[ -n "$matched" ]]; then - echo "RELEVANT=true" >> "$GITHUB_ENV" - fi - - - uses: actions/checkout@v3 - if: ${{ env.RELEVANT == 'true' }} - - - uses: actions/setup-python@v4 - if: ${{ env.RELEVANT == 'true' }} - with: - python-version: '3.8' - - - name: "Recompile requirements" - if: ${{ env.RELEVANT == 'true' }} - run: | - make compile-requirements - - - name: Fail if compiling requirements caused changes - if: ${{ env.RELEVANT == 'true' }} - run: | - SUMMARY_HELP=$(cat <<'EOMARKDOWN' - # Inconsistent Python dependencies - - It appears that the Python dependencies in this PR are inconsistent: A re-run of - `make compile-requirements` produced changes. This might mean that your PR would - fail to deploy properly in production, or could have inconsistent behavior for - developers. - - Please see the requirements README for information on how to resolve this: - https://github.com/openedx/edx-platform/blob/master/requirements/README.rst#inconsistent-dependencies - EOMARKDOWN - ) - - make_summary () { - echo "$SUMMARY_HELP" - echo - echo "----" - echo - echo "Diff follows:" - echo - echo '```' - git diff || true - echo '```' - } - - git diff --quiet --exit-code || { - # Job Summaries are cool, but echo to the job log as well, because - # that's where the PR checks will actually link to. - make_summary | tee -a $GITHUB_STEP_SUMMARY - exit 1 - } diff --git a/.github/workflows/check-for-tutorial-prs.yml b/.github/workflows/check-for-tutorial-prs.yml deleted file mode 100644 index 5d64a50573fd..000000000000 --- a/.github/workflows/check-for-tutorial-prs.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow detects PRs that make changes to lms/templates/dashboard.html -# and only lms/templates/dashboard.html. This is the file that users are -# guided through changing in the Open edX tutorial: -# https://docs.openedx.org/en/latest/developers/quickstarts/first_openedx_pr.html#exercise-update-the-learner-dashboard - -# If this is the only file changed in the PR, we comment on the PR congratulating -# the user and letting others know that this is not a community PR in need of -# review. CODEOWNERS will tag a triaging team to provide reviews & ultimately -# close the PR. - -name: Check for Tutorial PR -description: Welcome contributors making their first PR from the tutorial -on: - pull_request: - types: [opened] - paths: - - 'lms/templates/dashboard.html' - -jobs: - # Provide helpful bot comment - comment: - runs-on: ubuntu-latest - name: provide helpful bot comment - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Comment PR - uses: thollander/actions-comment-pull-request@v2 - with: - message: | - 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 diff --git a/.github/workflows/ci-static-analysis.yml b/.github/workflows/ci-static-analysis.yml deleted file mode 100644 index 33415601fed4..000000000000 --- a/.github/workflows/ci-static-analysis.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Static analysis - -on: pull_request - -jobs: - tests: - name: Static analysis - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ['3.8', '3.11'] - os: ['ubuntu-20.04'] - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install system requirements - run: sudo apt update && sudo apt install -y libxmlsec1-dev - - - name: Install pip - run: python -m pip install -r requirements/pip.txt - - - 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@v3 - 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 - - - name: Static code analysis - run: make check-types diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml deleted file mode 100644 index fec11d6c259b..000000000000 --- a/.github/workflows/commitlint.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Run commitlint on the commit messages in a pull request. - -name: Lint Commit Messages - -on: - - pull_request - -jobs: - commitlint: - uses: openedx/.github/.github/workflows/commitlint.yml@master diff --git a/.github/workflows/compile-python-requirements.yml b/.github/workflows/compile-python-requirements.yml deleted file mode 100644 index 18e68aa0ad6a..000000000000 --- a/.github/workflows/compile-python-requirements.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Recompile Python dependencies - -on: - workflow_dispatch: - inputs: - branch: - description: 'Target branch to create requirements PR against' - required: true - default: 'master' - type: string - -defaults: - run: - shell: bash # making this explicit opts into -e -o pipefail - -jobs: - recompile-python-dependencies: - runs-on: ubuntu-20.04 - - steps: - - name: Check out target branch - uses: actions/checkout@v3 - with: - ref: "${{ inputs.branch }}" - - - name: Set up Python environment - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Run make compile-requirements - env: - PACKAGE: "${{ inputs.package }}" - run: | - make compile-requirements - - - name: PR preflight - run: | - if git diff --exit-code; then - # Fail early (and avoid quiet failure of create-pull-request action) - echo "Error: No changes, so not creating PR." | tee -a "$GITHUB_STEP_SUMMARY" - exit 1 - fi - - - name: Make a PR - id: make-pr - uses: peter-evans/create-pull-request@v5 - with: - branch: "${{ github.triggering_actor }}/compile-python-deps" - branch-suffix: short-commit-hash - add-paths: requirements - commit-message: | - feat: Recompile Python dependencies - - Commit generated by workflow `${{ github.workflow_ref }}` - title: "chore: Recompile Python dependencies" - body: >- - PR generated by workflow `${{ github.workflow_ref }}` - on behalf of @${{ github.triggering_actor }}. - assignees: "${{ github.triggering_actor }}" - reviewers: "${{ github.triggering_actor }}" - - - name: Job summary - env: - PR_URL: "${{ steps.make-pr.outputs.pull-request-url }}" - run: | - if [[ -z "$PR_URL" ]]; then - echo "PR not created; see log for more information" | tee -a "$GITHUB_STEP_SUMMARY" - exit 1 - else - echo "PR created or updated: $PR_URL" | tee -a "$GITHUB_STEP_SUMMARY" - fi diff --git a/.github/workflows/docker-compose.yml.mysqldbdump b/.github/workflows/docker-compose.yml.mysqldbdump deleted file mode 100644 index 87f0321374ca..000000000000 --- a/.github/workflows/docker-compose.yml.mysqldbdump +++ /dev/null @@ -1,23 +0,0 @@ -version: '3' -services: - mysql: - image: mysql:5.7 - container_name: edx.devstack.mysql80 - ports: - - '3306:3306' - environment: - MYSQL_ROOT_PASSWORD: "" - MYSQL_ALLOW_EMPTY_PASSWORD: "yes" - volumes: - - ./init:/docker-entrypoint-initdb.d - healthcheck: - test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] - timeout: 20s - retries: 10 - edxapp: - image: edxops/edxapp:latest - command: bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && make migrate' - volumes: - - ../../:/edx/app/edxapp/edx-platform - depends_on: - - mysql diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 978e616ee62a..000000000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Push Docker Images - -on: - push: - branches: - - master -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - push: - runs-on: ubuntu-latest - if: github.event_name == 'push' - - strategy: - matrix: - variant: - - "lms_dev" - - "cms_dev" - - "cms" - - "lms" - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - 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 diff --git a/.github/workflows/js-tests.yml b/.github/workflows/js-tests.yml deleted file mode 100644 index 179b376b6855..000000000000 --- a/.github/workflows/js-tests.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Javascript tests - -on: - pull_request: - push: - branches: - - master - -jobs: - run_tests: - name: JS - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-20.04 ] - node-version: [ 18 ] - python-version: [ '3.8', '3.11' ] - - steps: - - - uses: actions/checkout@v2 - - 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 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 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@v4 - 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: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v3 - 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 - - - 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@v3 - with: - name: Build-Artifacts - path: | - reports/**/* - test_root/log/*.png - test_root/log/*.log - **/TEST-*.xml diff --git a/.github/workflows/lint-imports.yml b/.github/workflows/lint-imports.yml deleted file mode 100644 index 243b44d2039d..000000000000 --- a/.github/workflows/lint-imports.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Lint Python Imports - -on: - pull_request: - push: - branches: - - master - -jobs: - - lint-imports: - name: Lint Python Imports - runs-on: ubuntu-20.04 - - steps: - - name: Check out branch - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - name: Install system requirements - run: sudo apt update && sudo apt install -y libxmlsec1-dev - - - name: Install pip - run: python -m pip install -r requirements/pip.txt - - - 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@v3 - 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: pip install -r requirements/edx/development.txt - - # As long there are sub-projects[1] in edx-platform, we analyze each - # project separately here, in order to make import-linting errors easier - # to pinpoint. - # - # [1] https://openedx.atlassian.net/browse/BOM-2579 - - - name: Analyze imports (repo root) - run: make lint-imports diff --git a/.github/workflows/lockfileversion-check.yml b/.github/workflows/lockfileversion-check.yml deleted file mode 100644 index 916dcb40d28d..000000000000 --- a/.github/workflows/lockfileversion-check.yml +++ /dev/null @@ -1,13 +0,0 @@ -#check package-lock file version - -name: Lockfile Version check - -on: - push: - branches: - - master - pull_request: - -jobs: - version-check: - uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master diff --git a/.github/workflows/migrations-check.yml b/.github/workflows/migrations-check.yml deleted file mode 100644 index 417371c64626..000000000000 --- a/.github/workflows/migrations-check.yml +++ /dev/null @@ -1,133 +0,0 @@ -name: Check Django Migrations - -on: - workflow_dispatch: - pull_request: - push: - branches: - - master - -jobs: - check_migrations: - name: check migrations - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-20.04 ] - python-version: [ '3.8', '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 - django-version: ["pinned"] - mongo-version: ["4", "7"] - mysql-version: ["8"] - services: - mongo: - image: mongo:${{ matrix.mongo-version }} - ports: - - 27017:27017 - # Note: Calling mongo here only works with mongo 4, in newer versions of mongo - # we'll have to use `mongosh`, hence the 'which mongosh mongo'. - options: >- - --health-cmd "$(which mongosh mongo) --quiet --eval 'db.runCommand(\"ping\")'" - --health-interval 10s - --health-timeout 5s - --health-retries 3 - mysql: - image: mysql:${{ matrix.mysql-version }} - ports: - - 3306:3306 - env: - MYSQL_DATABASE: "edxapp" - MYSQL_USER: "edxapp001" - MYSQL_PASSWORD: "password" - MYSQL_RANDOM_ROOT_PASSWORD: true - options: >- - --health-cmd "mysqladmin ping" - --health-interval 10s - --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: 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@v2 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - 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: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v3 - 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: 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 - - # This job aggregates test results. It's the required check for branch protection. - # https://github.com/marketplace/actions/alls-green#why - # https://github.com/orgs/community/discussions/33579 - success: - name: Migrations checks successful - if: always() - needs: - - check_migrations - runs-on: ubuntu-latest - steps: - - name: Decide whether the needed jobs succeeded or failed - # uses: re-actors/alls-green@v1.2.1 - uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe - with: - jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/publish-ci-docker-image.yml b/.github/workflows/publish-ci-docker-image.yml deleted file mode 100644 index 20b238c2380d..000000000000 --- a/.github/workflows/publish-ci-docker-image.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Push CI Runner Docker Image - -on: - workflow_dispatch: - schedule: - - cron: "0 1 * * 3" - -jobs: - push: - runs-on: ubuntu-20.04 - - steps: - - name: Checkout - uses: actions/checkout@v2 - - # This has to happen after checkout in order for gh to work. - - name: "Cancel scheduled job on forks" - if: github.repository != 'openedx/edx-platform' && github.event_name == 'schedule' - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - run: | - gh run cancel "${{ github.run_id }}" - gh run watch "${{ github.run_id }}" - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.TOOLS_EDX_ECR_USER_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.TOOLS_EDX_ECR_USER_AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Log in to ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - - - name: Build, tag, and push image to Amazon ECR - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: actions-runner - IMAGE_TAG: latest - 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/pylint-checks.yml b/.github/workflows/pylint-checks.yml deleted file mode 100644 index c2e04fc191d3..000000000000 --- a/.github/workflows/pylint-checks.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Pylint Checks - -on: - pull_request: - push: - branches: - - master - -jobs: - run-pylint: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - include: - - module-name: lms-1 - path: "--django-settings-module=lms.envs.test lms/djangoapps/badges/ lms/djangoapps/branding/ lms/djangoapps/bulk_email/ lms/djangoapps/bulk_enroll/ lms/djangoapps/bulk_user_retirement/ lms/djangoapps/ccx/ lms/djangoapps/certificates/ lms/djangoapps/commerce/ lms/djangoapps/course_api/ lms/djangoapps/course_blocks/ lms/djangoapps/course_home_api/ lms/djangoapps/course_wiki/ lms/djangoapps/coursewarehistoryextended/ lms/djangoapps/debug/ lms/djangoapps/courseware/ lms/djangoapps/course_goals/ lms/djangoapps/rss_proxy/" - - module-name: lms-2 - path: "--django-settings-module=lms.envs.test lms/djangoapps/gating/ lms/djangoapps/grades/ lms/djangoapps/instructor/ lms/djangoapps/instructor_analytics/ lms/djangoapps/discussion/ lms/djangoapps/edxnotes/ lms/djangoapps/email_marketing/ lms/djangoapps/experiments/ lms/djangoapps/instructor_task/ lms/djangoapps/learner_dashboard/ lms/djangoapps/learner_home/ lms/djangoapps/lms_initialization/ lms/djangoapps/lms_xblock/ lms/djangoapps/lti_provider/ lms/djangoapps/mailing/ lms/djangoapps/mobile_api/ lms/djangoapps/monitoring/ lms/djangoapps/ora_staff_grader/ lms/djangoapps/program_enrollments/ lms/djangoapps/rss_proxy lms/djangoapps/static_template_view/ lms/djangoapps/staticbook/ lms/djangoapps/support/ lms/djangoapps/survey/ lms/djangoapps/teams/ lms/djangoapps/tests/ lms/djangoapps/user_tours/ lms/djangoapps/verify_student/ lms/djangoapps/mfe_config_api/ lms/envs/ lms/lib/ lms/tests.py" - - module-name: openedx-1 - path: "--django-settings-module=lms.envs.test openedx/core/types/ openedx/core/djangoapps/ace_common/ openedx/core/djangoapps/agreements/ openedx/core/djangoapps/api_admin/ openedx/core/djangoapps/auth_exchange/ openedx/core/djangoapps/bookmarks/ openedx/core/djangoapps/cache_toolbox/ openedx/core/djangoapps/catalog/ openedx/core/djangoapps/ccxcon/ openedx/core/djangoapps/commerce/ openedx/core/djangoapps/common_initialization/ openedx/core/djangoapps/common_views/ openedx/core/djangoapps/config_model_utils/ openedx/core/djangoapps/content/ openedx/core/djangoapps/content_libraries/ openedx/core/djangoapps/content_staging/ openedx/core/djangoapps/contentserver/ openedx/core/djangoapps/cookie_metadata/ openedx/core/djangoapps/cors_csrf/ openedx/core/djangoapps/course_apps/ openedx/core/djangoapps/course_date_signals/ openedx/core/djangoapps/course_groups/ openedx/core/djangoapps/courseware_api/ openedx/core/djangoapps/crawlers/ openedx/core/djangoapps/credentials/ openedx/core/djangoapps/credit/ openedx/core/djangoapps/dark_lang/ openedx/core/djangoapps/debug/ openedx/core/djangoapps/demographics/ openedx/core/djangoapps/discussions/ openedx/core/djangoapps/django_comment_common/ openedx/core/djangoapps/embargo/ openedx/core/djangoapps/enrollments/ openedx/core/djangoapps/external_user_ids/ openedx/core/djangoapps/zendesk_proxy/ openedx/core/djangolib/ openedx/core/lib/ openedx/core/tests/ openedx/core/djangoapps/course_live/" - - module-name: openedx-2 - path: "--django-settings-module=lms.envs.test openedx/core/djangoapps/geoinfo/ openedx/core/djangoapps/header_control/ openedx/core/djangoapps/heartbeat/ openedx/core/djangoapps/lang_pref/ openedx/core/djangoapps/models/ openedx/core/djangoapps/monkey_patch/ openedx/core/djangoapps/oauth_dispatch/ openedx/core/djangoapps/olx_rest_api/ openedx/core/djangoapps/password_policy/ openedx/core/djangoapps/plugin_api/ openedx/core/djangoapps/plugins/ openedx/core/djangoapps/profile_images/ openedx/core/djangoapps/programs/ openedx/core/djangoapps/safe_sessions/ openedx/core/djangoapps/schedules/ openedx/core/djangoapps/service_status/ openedx/core/djangoapps/session_inactivity_timeout/ openedx/core/djangoapps/signals/ openedx/core/djangoapps/site_configuration/ openedx/core/djangoapps/system_wide_roles/ openedx/core/djangoapps/theming/ openedx/core/djangoapps/user_api/ openedx/core/djangoapps/user_authn/ openedx/core/djangoapps/util/ openedx/core/djangoapps/verified_track_content/ openedx/core/djangoapps/video_config/ openedx/core/djangoapps/video_pipeline/ openedx/core/djangoapps/waffle_utils/ openedx/core/djangoapps/xblock/ openedx/core/djangoapps/xmodule_django/ openedx/core/tests/ openedx/features/ openedx/testing/ openedx/tests/ openedx/core/djangoapps/learner_pathway/ openedx/core/djangoapps/notifications/ openedx/core/djangoapps/staticfiles/ openedx/core/djangoapps/content_tagging/" - - module-name: common - path: "--django-settings-module=lms.envs.test common" - - module-name: cms - path: "--django-settings-module=cms.envs.test cms" - - module-name: xmodule - path: "--django-settings-module=lms.envs.test xmodule" - - name: pylint ${{ matrix.module-name }} - steps: - - name: Check out repo - uses: actions/checkout@v2 - - - name: Install required system packages - run: sudo apt-get update && sudo apt-get install libxmlsec1-dev - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - - 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@v3 - with: - path: ${{ steps.pip-cache-dir.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }} - restore-keys: ${{ runner.os }}-pip- - - - name: Install required Python dependencies - run: | - # dev-requirements is needed because the linter will otherwise - # trip over some dev-only things like django-debug-toolbar - # (import debug_toolbar) that aren't in testing.txt. - make dev-requirements - # After all requirements are installed, check that they're consistent with each other - pip check - - - name: Run quality tests - run: | - pylint ${{ matrix.path }} - - # This job aggregates test results. It's the required check for branch protection. - # https://github.com/marketplace/actions/alls-green#why - # https://github.com/orgs/community/discussions/33579 - success: - name: Pylint checks successful - if: always() - needs: - - run-pylint - runs-on: ubuntu-latest - steps: - - name: Decide whether the needed jobs succeeded or failed - # uses: re-actors/alls-green@v1.2.1 - uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe - with: - jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml deleted file mode 100644 index 920659631958..000000000000 --- a/.github/workflows/quality-checks.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Quality checks - -on: - pull_request: - push: - branches: - - master - - open-release/lilac.master - -jobs: - run_tests: - name: Quality Others - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-20.04 ] - python-version: [ '3.8', '3.11' ] - node-version: [ 18 ] - - steps: - - - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - - 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: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-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: 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@v3 - 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: 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@v3 - with: - name: Build-Artifacts - path: | - **/reports/**/* - test_root/log/**/*.log - *.log diff --git a/.github/workflows/self-assign-issue.yml b/.github/workflows/self-assign-issue.yml deleted file mode 100644 index 37522fd57b1b..000000000000 --- a/.github/workflows/self-assign-issue.yml +++ /dev/null @@ -1,12 +0,0 @@ -# This workflow runs when a comment is made on the ticket -# If the comment starts with "assign me" it assigns the author to the -# ticket (case insensitive) - -name: Assign comment author to ticket if they say "assign me" -on: - issue_comment: - types: [created] - -jobs: - self_assign_by_comment: - uses: openedx/.github/.github/workflows/self-assign-issue.yml@master diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml deleted file mode 100644 index 870de732cf4f..000000000000 --- a/.github/workflows/semgrep.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Finds code problems by structural pattern matching. -# -# New rules can be added to test_root/semgrep/ and they should be picked up -# automatically. See https://semgrep.dev/docs/ for documentation. - -name: Semgrep code quality - -on: - pull_request: - push: - branches: - - master - -jobs: - run_semgrep: - name: Semgrep analysis - runs-on: "${{ matrix.os }}" - strategy: - matrix: - os: [ "ubuntu-20.04" ] - python-version: [ "3.8", '3.11' ] - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - uses: actions/setup-python@v4 - with: - python-version: "${{ matrix.python-version }}" - - - name: Install semgrep - run: | - make pre-requirements - pip-sync requirements/edx/semgrep.txt - - - name: Run semgrep - env: - # Peg this to some reasonable value so that semgrep's rewrapping - # of messages doesn't break up lines in an unpredictable manner: - # https://github.com/returntocorp/semgrep/issues/8608 - COLUMNS: 80 - run: | - semgrep scan --config test_root/semgrep/ --error --quiet \ - -- lms cms common openedx diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml deleted file mode 100644 index 704ff778a1b1..000000000000 --- a/.github/workflows/shellcheck.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Run ShellCheck on PRs and master - -# For more context, see: -# https://github.com/openedx/.github/blob/master/docs/decisions/0001-shellcheck.rst - -name: ShellCheck - -on: - pull_request: - push: - branches: - - master - -permissions: - contents: read - -jobs: - shellcheck: - strategy: - matrix: - os: ["ubuntu", "macos"] - uses: openedx/.github/.github/workflows/shellcheck.yml@master - with: - # For details on the meaning of each of these arguments, see: - # https://github.com/openedx/.github/blob/master/.github/workflows/shellcheck.yml - # We exclude `./node_modules/*` by default because we want people to easily be able to - # copy and run the command locally. Local copies of most of our services have a `./node_modules` - # directory that we want to ignore. - exclude-patterns: "./node_modules/*" - operating-system: "${{ matrix.os }}" - shellcheck-version: "v0.9.0" - #shellcheck-options: "" diff --git a/.github/workflows/static-assets-check.yml b/.github/workflows/static-assets-check.yml index db5ead905a8d..e09258624a2b 100644 --- a/.github/workflows/static-assets-check.yml +++ b/.github/workflows/static-assets-check.yml @@ -43,7 +43,7 @@ jobs: - name: Install system Packages run: | sudo apt-get update - sudo apt-get install libxmlsec1-dev pkg-config + sudo apt-get install libxmlsec1-dev=1.2.28-2 pkg-config - name: Setup Node uses: actions/setup-node@v4 @@ -70,6 +70,10 @@ jobs: run: | make base-requirements + - name: Show glibc version + run: | + ldd --version + - name: Initiate Mongo DB Service run: sudo systemctl start mongod diff --git a/.github/workflows/unit-tests-gh-hosted.yml b/.github/workflows/unit-tests-gh-hosted.yml deleted file mode 100644 index 3f3e60ae8ff5..000000000000 --- a/.github/workflows/unit-tests-gh-hosted.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: unit-tests-gh-hosted - -on: - pull_request: - push: - branches: - - master - - open-release/lilac.master - -jobs: - run-test: - name: ${{ matrix.shard_name }}(py=${{ matrix.python-version }},dj=${{ matrix.django-version }},mongo=${{ matrix.mongo-version }}) - if: (github.repository != 'openedx/edx-platform' && github.repository != 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == true)) - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: - - "3.8" - - "3.11" - django-version: - - "pinned" - # When updating the shards, remember to make the same changes in - # .github/workflows/unit-tests.yml - shard_name: - - "lms-1" - - "lms-2" - - "lms-3" - - "lms-4" - - "lms-5" - - "lms-6" - - "openedx-1-with-lms" - - "openedx-2-with-lms" - - "openedx-1-with-cms" - - "openedx-2-with-cms" - - "cms-1" - - "cms-2" - - "common-with-lms" - - "common-with-cms" - - "xmodule-with-lms" - - "xmodule-with-cms" - mongo-version: - - "4.4" - - "7.0" - - # We only need to test Mongo 4.4 for modules that directly interface with Mongo (that is: xmodule.modulestore) - exclude: - - mongo-version: "4.4" - include: - - shard_name: "xmodule-with-cms" - python-version: "3.11" - django-version: "pinned" - mongo-version: "4.4" - - shard_name: "xmodule-with-lms" - python-version: "3.11" - django-version: "pinned" - mongo-version: "4.4" - steps: - - uses: actions/checkout@v2 - - - name: Install Required System Packages - run: sudo apt-get update && sudo apt-get install libxmlsec1-dev lynx - - - name: Start MongoDB - uses: supercharge/mongodb-github-action@1.7.0 - with: - mongodb-version: ${{ matrix.mongo-version}} - - - name: Setup Python - uses: actions/setup-python@v4 - 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: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v3 - 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 - 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: Setup and run tests - uses: ./.github/actions/unit-tests - - collect-and-verify: - if: (github.repository != 'openedx/edx-platform' && github.repository != 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == true)) - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: [ '3.11' ] - django-version: - - "pinned" - steps: - - uses: actions/checkout@v2 - - - name: Install Required System Packages - run: sudo apt-get update && sudo apt-get install libxmlsec1-dev - - - name: Setup Python - uses: actions/setup-python@v4 - 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: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v3 - 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 - run: | - make test-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: verify unit tests count - uses: ./.github/actions/verify-tests-count diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index bf7fe86ab765..000000000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,185 +0,0 @@ -name: unit-tests - -on: - pull_request: - push: - branches: - - master - -jobs: - run-tests: - name: ${{ matrix.shard_name }}(py=${{ matrix.python-version }},dj=${{ matrix.django-version }},mongo=${{ matrix.mongo-version }}) - if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false)) - runs-on: [ edx-platform-runner ] - strategy: - matrix: - python-version: - - "3.8" - - "3.11" - django-version: - - "pinned" - # When updating the shards, remember to make the same changes in - # .github/workflows/unit-tests-gh-hosted.yml - shard_name: - - "lms-1" - - "lms-2" - - "lms-3" - - "lms-4" - - "lms-5" - - "lms-6" - - "openedx-1-with-lms" - - "openedx-2-with-lms" - - "openedx-1-with-cms" - - "openedx-2-with-cms" - - "cms-1" - - "cms-2" - - "common-with-lms" - - "common-with-cms" - - "xmodule-with-lms" - - "xmodule-with-cms" - mongo-version: - - "4.4" - - "7.0" - - # We only need to test Mongo 4.4 for modules that directly interface with Mongo (that is: xmodule.modulestore) - exclude: - - mongo-version: "4.4" - include: - - shard_name: "xmodule-with-cms" - python-version: "3.11" - django-version: "pinned" - mongo-version: "4.4" - - shard_name: "xmodule-with-lms" - python-version: "3.11" - django-version: "pinned" - mongo-version: "4.4" - - steps: - - name: sync directory owner - run: sudo chown runner:runner -R .* - - - name: install mongo version - run: | - if [[ "${{ matrix.mongo-version }}" != "4.4" ]]; then - sudo apt-get purge -y "mongodb-org*" - sudo apt-get remove -y mongodb-org - wget -qO - https://www.mongodb.org/static/pgp/server-${{ matrix.mongo-version }}.asc | sudo apt-key add - - echo "deb https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/${{ matrix.mongo-version }} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${{ matrix.mongo-version }}.list - sudo apt-get update && sudo apt-get install -y mongodb-org="${{ matrix.mongo-version }}.*" - fi - - - name: start mongod server for tests - run: | - sudo mkdir -p /data/db - sudo chmod -R a+rw /data/db - mongod & - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: checkout repo - uses: actions/checkout@v3 - - - name: install requirements - run: | - sudo make test-requirements - if [[ "${{ matrix.django-version }}" != "pinned" ]]; then - sudo pip install "django~=${{ matrix.django-version }}.0" - sudo pip check # fail if this test-reqs/Django combination is broken - fi - - - name: list installed package versions - run: | - sudo pip freeze - - - name: Setup and run tests - uses: ./.github/actions/unit-tests - - - name: Renaming coverage data file - run: | - mv reports/.coverage reports/${{ matrix.shard_name }}.coverage - - - name: Upload coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: reports/${{matrix.shard_name}}.coverage - - # This job aggregates test results. It's the required check for branch protection. - # https://github.com/marketplace/actions/alls-green#why - # https://github.com/orgs/community/discussions/33579 - success: - name: Unit tests successful - if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false)) - needs: - - run-tests - runs-on: ubuntu-latest - steps: - - name: Decide whether the needed jobs succeeded or failed - # uses: re-actors/alls-green@v1.2.1 - uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe - with: - jobs: ${{ toJSON(needs) }} - - compile-warnings-report: - runs-on: [ edx-platform-runner ] - needs: [ run-tests ] - steps: - - name: sync directory owner - run: sudo chown runner:runner -R .* - - uses: actions/checkout@v3 - - name: collect pytest warnings files - uses: actions/download-artifact@v3 - with: - name: pytest-warnings-json - path: test_root/log - - - name: display structure of downloaded files - run: ls -la test_root/log - - - name: compile warnings report - run: | - python openedx/core/process_warnings.py --dir-path test_root/log --html-path reports/pytest_warnings/warning_report_all.html - - - name: save warning report - if: success() - uses: actions/upload-artifact@v3 - with: - name: pytest-warning-report-html - path: | - reports/pytest_warnings/warning_report_all.html - - # Combine and upload coverage reports. - coverage: - needs: run-tests - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [ 3.8 ] - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Download all artifacts - uses: actions/download-artifact@v3 - with: - name: coverage - path: reports - - - name: Install Python dependencies - run: | - pip install -r requirements/edx/coverage.txt - - - name: Run coverage - run: | - coverage combine reports/* - coverage report - coverage xml - - uses: codecov/codecov-action@v3 diff --git a/.github/workflows/units-test-scripts-structures-pruning.yml b/.github/workflows/units-test-scripts-structures-pruning.yml deleted file mode 100644 index 9fab62643c3b..000000000000 --- a/.github/workflows/units-test-scripts-structures-pruning.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: units-test-scripts-common - -on: - pull_request: - push: - branches: - - master - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - matrix: - python-version: [ '3.8', '3.11', '3.12' ] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r scripts/structures_pruning/requirements/testing.txt - - - name: Run pytest - run: | - pytest scripts/structures_pruning diff --git a/.github/workflows/units-test-scripts-user-retirement.yml b/.github/workflows/units-test-scripts-user-retirement.yml deleted file mode 100644 index 22bbdc3f617e..000000000000 --- a/.github/workflows/units-test-scripts-user-retirement.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: units-test-scripts-user-retirement - -on: - pull_request: - push: - branches: - - master - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - matrix: - python-version: [ '3.8', '3.11', '3.12'] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r scripts/user_retirement/requirements/testing.txt - - - name: Run pytest - run: | - pytest scripts/user_retirement diff --git a/.github/workflows/update-geolite-database.yml b/.github/workflows/update-geolite-database.yml deleted file mode 100644 index 3289d31a2212..000000000000 --- a/.github/workflows/update-geolite-database.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Update GeoLite Database - -on: - schedule: - - cron: "0 3 1 * *" - workflow_dispatch: - inputs: - branch: - description: 'Target branch against which to create PR' - required: false - 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' - -jobs: - download-and-replace: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Download GeoLite tar file - run: | - wget -O '${{ env.TAR_FILE_NAME }}' '${{ env.MAXMIND_URL }}'\ - - - name: Download GeoLite sha256 file - run: | - wget -O '${{ env.TAR_SHA256_FILE_NAME }}' '${{ env.MAXMIND_SHA256_URL }}'\ - - - name: Check SHA256 hash - run: | - sha256sum '${{ env.TAR_FILE_NAME }}' | grep $(cat '${{ env.TAR_SHA256_FILE_NAME }}' | cut -d' ' -f1) - - - name: Extract tar file - run: | - tar xvf '${{ env.TAR_FILE_NAME }}' - - - name: Copy DB file to destination path - run: | - find . -type d -name '${{ env.TAR_UNZIPPED_ROOT_PATTERN }}' -exec cp {}/'${{ env.DB_FILE }}' '${{ env.DB_DESTINATION_PATH }}'/ \; - - - name: Delete un-required content - run: | - rm '${{ env.TAR_FILE_NAME }}' - rm '${{ env.TAR_SHA256_FILE_NAME }}' - find . -type d -name '${{ env.TAR_UNZIPPED_ROOT_PATTERN }}' -exec rm -r {} \; || true - - - name: PR preflight - run: | - if git diff --exit-code; then - echo 'Summary: No updates/changes detected. Terminating the run and no pull request is going to be created.' | tee -a '$GITHUB_STEP_SUMMARY' - exit 1 - else - echo 'Updates/changes detected, going to create PR.' - fi - - - name: Setup git - run: | - git config --global user.email '${{ github.actor }}@users.noreply.github.com' - git config --global user.name '${{ github.actor }}' - - - name: Create a branch, commit the code and make a PR - id: create-pr - run: | - BRANCH="${{ github.actor }}/geoip2-bot-update-country-database-$(echo "${{ github.sha }}" | cut -c 1-7)" - git checkout -b $BRANCH - git add . - git status - git commit -m "chore: geoip2: update maxmind geolite country database" - git push --set-upstream origin $BRANCH - PR_URL=$(gh pr create \ - --title "Update GeoLite Database" \ - --body "PR generated by workflow `${{ github.workflow }}` on behalf of @${{ github.actor }}." \ - --head $BRANCH \ - --base 'master' \ - --reviewer 'feanil' \ - | grep -o 'https://github.com/.*/pull/[0-9]*') - echo "PR Created: ${PR_URL}" - echo "pull-request-url=$PR_URL" >> $GITHUB_OUTPUT - env: - GH_TOKEN: ${{ github.token }} - - - name: Job summary - run: | - PR_URL=${{ steps.create-pr.outputs.pull-request-url }} - if [[ -z '$PR_URL' ]]; then - echo 'Error: PR creation unsuccessful; refer to the log for further details.' | tee -a "${GITHUB_STEP_SUMMARY}" - exit 1 - else - echo "PR: ${PR_URL}" | tee -a "${GITHUB_STEP_SUMMARY}" - fi diff --git a/.github/workflows/upgrade-one-python-dependency.yml b/.github/workflows/upgrade-one-python-dependency.yml deleted file mode 100644 index 91e042a112f4..000000000000 --- a/.github/workflows/upgrade-one-python-dependency.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: Upgrade one Python dependency - -on: - workflow_dispatch: - inputs: - branch: - description: 'Target branch to create requirements PR against' - required: true - default: 'master' - type: string - package: - 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: '' - type: string - change_desc: - description: | - Description of change, for commit message and PR. (What does the new version add or fix?) - default: '' - type: string - -defaults: - run: - shell: bash # making this explicit opts into -e -o pipefail - -jobs: - upgrade-one-python-dependency: - runs-on: ubuntu-20.04 - - steps: - - name: Check out target branch - uses: actions/checkout@v3 - with: - ref: "${{ inputs.branch }}" - - - name: Set up Python environment - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Update any pinned dependencies - env: - NEW_VERSION: "${{ inputs.version }}" - PACKAGE: "${{ inputs.package }}" - run: | - sed 's/^\('$PACKAGE'[^#]*\)==[^ #]\+/\1=='$NEW_VERSION'/' -i requirements/constraints.txt - - - name: Run make upgrade-package - env: - PACKAGE: "${{ inputs.package }}" - run: | - make upgrade-package package="$PACKAGE" - - - name: PR preflight - env: - CHANGE_DESC: "${{ inputs.change_desc }}" - run: | - if git diff --exit-code; then - # Fail early (and avoid quiet failure of create-pull-request action) - echo "Error: No changes, so not creating PR." | tee -a "$GITHUB_STEP_SUMMARY" - exit 1 - else - # There are changes to commit, so prep some info for the PR. - - # This is honestly a lot to go through just to say "add two newlines - # on the end if the variable isn't empty" but I guess this is what we - # have to do to get a conditional delimiter. - if [[ -z "$CHANGE_DESC" ]]; then - echo "body_prefix=" >> "$GITHUB_ENV" - else - EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) - echo "body_prefix<<$EOF" >> "$GITHUB_ENV" - echo "$CHANGE_DESC" >> "$GITHUB_ENV" - echo "" >> "$GITHUB_ENV" - echo "" >> "$GITHUB_ENV" - echo "$EOF" >> "$GITHUB_ENV" - fi - fi - - - name: Make a PR - id: make-pr - uses: peter-evans/create-pull-request@v6 - with: - branch: "${{ github.triggering_actor }}/upgrade-${{ inputs.package }}" - branch-suffix: short-commit-hash - add-paths: | - requirements - scripts/**/requirements* - commit-message: | - feat: Upgrade Python dependency ${{ inputs.package }} - - ${{ env.body_prefix }}Commit generated by workflow `${{ github.workflow_ref }}` - title: "feat: Upgrade Python dependency ${{ inputs.package }}" - body: >- - ${{ env.body_prefix }}PR generated by workflow `${{ github.workflow_ref }}` - on behalf of @${{ github.triggering_actor }}. - assignees: "${{ github.triggering_actor }}" - reviewers: "${{ github.triggering_actor }}" - - - name: Job summary - env: - PR_URL: "${{ steps.make-pr.outputs.pull-request-url }}" - run: | - if [[ -z "$PR_URL" ]]; then - echo "PR not created; see log for more information" | tee -a "$GITHUB_STEP_SUMMARY" - exit 1 - else - echo "PR created or updated: $PR_URL" | tee -a "$GITHUB_STEP_SUMMARY" - fi diff --git a/.github/workflows/upgrade-python-requirements.yml b/.github/workflows/upgrade-python-requirements.yml deleted file mode 100644 index fcacf81929af..000000000000 --- a/.github/workflows/upgrade-python-requirements.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Upgrade Requirements - -on: - schedule: - - cron: "0 2 * * 2" - workflow_dispatch: - 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 - 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 }} - diff --git a/.github/workflows/verify-dunder-init.yml b/.github/workflows/verify-dunder-init.yml deleted file mode 100644 index aefc0f53b6f5..000000000000 --- a/.github/workflows/verify-dunder-init.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: CI - -on: - pull_request: - branches: - - master - -jobs: - - verify_dunder_init: - - name: Verify __init__.py Files - runs-on: ubuntu-20.04 - - steps: - - - name: Check out branch - uses: actions/checkout@v2 - - - 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 diff --git a/.github/workflows/verify-gha-unit-tests-count.yml b/.github/workflows/verify-gha-unit-tests-count.yml deleted file mode 100644 index c68092942d70..000000000000 --- a/.github/workflows/verify-gha-unit-tests-count.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: verify unit tests count - -on: - pull_request: - push: - branches: - - master - -jobs: - collect-and-verify: - if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false)) - runs-on: [ edx-platform-runner ] - steps: - - name: sync directory owner - run: sudo chown runner:runner -R .* - - - uses: actions/checkout@v2 - - name: install requirements - run: | - sudo make test-requirements - - - name: verify unit tests count - uses: ./.github/actions/verify-tests-count