From 36864b40314b7577754ef447d982b3f9aa1bf7f7 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 17:11:08 +0500 Subject: [PATCH 001/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 138 ++++++++ .github/workflows/unit-tests.yml | 312 +++++++++---------- 2 files changed, 294 insertions(+), 156 deletions(-) create mode 100644 .github/workflows/capture_new_migrations.yml diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml new file mode 100644 index 000000000000..1e0f2ab0157d --- /dev/null +++ b/.github/workflows/capture_new_migrations.yml @@ -0,0 +1,138 @@ +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 ] + # 'pinned' is used to install the latest patch version of Django + # within the global constraint i.e. Django==3.2.21 in current case + # because we have global constraint of Django<4.2 + django-version: ["pinned", "4.2"] + mongo-version: ["4"] + mysql-version: ["8"] + # excluding mysql5.7 with Django 4.2 since Django 4.2 has + # dropped support for MySQL<8 + exclude: + - django-version: "4.2" + mysql-version: "5.7" + 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` + options: >- + --health-cmd "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 showmigrations + echo "Running the CMS migrations." + ./manage.py cms showmigrations + + # 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/unit-tests.yml b/.github/workflows/unit-tests.yml index c3b1086c20eb..626a2ac54f12 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,156 +1,156 @@ -name: unit-tests - -on: - pull_request: - push: - branches: - - master - -jobs: - run-tests: - name: python-${{ matrix.python-version }},django-${{ matrix.django-version }},${{ matrix.shard_name }} - 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" - django-version: - - "pinned" - - "4.2" - # 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" - # We expect Django 4.0 to fail, so don't stop when it fails. - continue-on-error: ${{ matrix.django-version == '4.0' }} - - steps: - - name: sync directory owner - run: sudo chown runner:runner -R .* - - - name: checkout repo - uses: actions/checkout@v3 - - - name: start mongod server for tests - run: | - sudo mkdir -p /data/db - sudo chmod -R a+rw /data/db - mongod & - - - 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 +#name: unit-tests +# +#on: +# pull_request: +# push: +# branches: +# - master +# +#jobs: +# run-tests: +# name: python-${{ matrix.python-version }},django-${{ matrix.django-version }},${{ matrix.shard_name }} +# 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" +# django-version: +# - "pinned" +# - "4.2" +# # 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" +# # We expect Django 4.0 to fail, so don't stop when it fails. +# continue-on-error: ${{ matrix.django-version == '4.0' }} +# +# steps: +# - name: sync directory owner +# run: sudo chown runner:runner -R .* +# +# - name: checkout repo +# uses: actions/checkout@v3 +# +# - name: start mongod server for tests +# run: | +# sudo mkdir -p /data/db +# sudo chmod -R a+rw /data/db +# mongod & +# +# - 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 From 4cccc1c48668febbb94b667e91244b9f88304da6 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 17:11:47 +0500 Subject: [PATCH 002/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 1e0f2ab0157d..e8fefa0f6f83 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -1,4 +1,4 @@ -name: Check Django Migrations +name: Check any new django Migrations on: workflow_dispatch: From 7c1e179fd7796ff7b0a927ef5dd1d0b747b67991 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 17:14:12 +0500 Subject: [PATCH 003/127] build: capturing new migrations. --- requirements/edx/base.txt | 2 +- requirements/edx/testing.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index bd08da99a6cc..1b8a6453dc36 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -1086,7 +1086,7 @@ slumber==0.7.1 # edx-rest-api-client snowflake-connector-python==3.2.1 # via edx-enterprise -social-auth-app-django==5.0.0 +social-auth-app-django==5.3.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/kernel.in diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 218485e8faf5..80b0b61ac56f 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -1433,7 +1433,7 @@ snowflake-connector-python==3.2.1 # via # -r requirements/edx/base.txt # edx-enterprise -social-auth-app-django==5.0.0 +social-auth-app-django==5.3.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt From e528ee71a3c78209071ea64a0c613e6eb5a7866a Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 17:39:02 +0500 Subject: [PATCH 004/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 55 +++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index e8fefa0f6f83..3e5094c41547 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -72,8 +72,10 @@ jobs: 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 + - name: Checkout master repo uses: actions/checkout@v2 + with: + ref: master - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -121,6 +123,57 @@ jobs: echo "Running the CMS migrations." ./manage.py cms showmigrations + + - name: Checkout branch 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 showmigrations + echo "Running the CMS migrations." + ./manage.py cms showmigrations + + # 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 From 278d58f10cf1053037c1223fb876de3e3a353b46 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 17:49:13 +0500 Subject: [PATCH 005/127] build: capturing new migrations. --- .github/workflows/migrations-check.yml | 276 ++++++++++++------------- 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/.github/workflows/migrations-check.yml b/.github/workflows/migrations-check.yml index 3929e7f10e6f..f94a903fcb6c 100644 --- a/.github/workflows/migrations-check.yml +++ b/.github/workflows/migrations-check.yml @@ -1,138 +1,138 @@ -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 ] - # 'pinned' is used to install the latest patch version of Django - # within the global constraint i.e. Django==3.2.21 in current case - # because we have global constraint of Django<4.2 - django-version: ["pinned", "4.2"] - mongo-version: ["4"] - mysql-version: ["5.7", "8"] - # excluding mysql5.7 with Django 4.2 since Django 4.2 has - # dropped support for MySQL<8 - exclude: - - django-version: "4.2" - mysql-version: "5.7" - 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` - options: >- - --health-cmd "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) }} +#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 ] +# # 'pinned' is used to install the latest patch version of Django +# # within the global constraint i.e. Django==3.2.21 in current case +# # because we have global constraint of Django<4.2 +# django-version: ["pinned", "4.2"] +# mongo-version: ["4"] +# mysql-version: ["5.7", "8"] +# # excluding mysql5.7 with Django 4.2 since Django 4.2 has +# # dropped support for MySQL<8 +# exclude: +# - django-version: "4.2" +# mysql-version: "5.7" +# 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` +# options: >- +# --health-cmd "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) }} From 7ff9d159a60577e4a396958fa0a1a62d2dc91478 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 17:52:14 +0500 Subject: [PATCH 006/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 3e5094c41547..c76badfd1d28 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -74,8 +74,6 @@ jobs: - name: Checkout master repo uses: actions/checkout@v2 - with: - ref: master - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From b8119f00734a1420a9f1fe3897897701f0755a49 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 17:54:34 +0500 Subject: [PATCH 007/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 27 -------------------- 1 file changed, 27 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index c76badfd1d28..38c48dfc7fb1 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -125,29 +125,6 @@ jobs: - name: Checkout branch 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 @@ -156,10 +133,6 @@ jobs: 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 From 4354d98f46e14b2fc5924f69f4e67b474c308408 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 18:00:22 +0500 Subject: [PATCH 008/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 38c48dfc7fb1..e9bb9f98f57d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -74,6 +74,9 @@ jobs: - name: Checkout master repo uses: actions/checkout@v2 + with: + ref: master + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From ebcca979f7b9fe13fdfc2fdef656db8692bda271 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 18:08:04 +0500 Subject: [PATCH 009/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 +++- requirements/edx/development.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index e9bb9f98f57d..f0f092e6a410 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -77,7 +77,6 @@ jobs: with: ref: master - - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -136,6 +135,9 @@ jobs: 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 diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index bc583442dcdf..7005f4350a0a 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -1890,7 +1890,7 @@ snowflake-connector-python==3.2.1 # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt # edx-enterprise -social-auth-app-django==5.0.0 +social-auth-app-django==5.3.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/doc.txt From 448b6b9c4e1552056dd93a56e40e170d71e4e6e7 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 18:24:12 +0500 Subject: [PATCH 010/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index f0f092e6a410..41d0b4a329fb 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -110,7 +110,7 @@ jobs: - name: list installed package versions run: | - sudo pip freeze + pip freeze - name: Run Tests env: @@ -123,7 +123,6 @@ jobs: echo "Running the CMS migrations." ./manage.py cms showmigrations - - name: Checkout branch repo uses: actions/checkout@v2 @@ -137,7 +136,7 @@ jobs: - name: list installed package versions run: | - sudo pip freeze + pip freeze - name: Run Tests env: LMS_CFG: lms/envs/minimal.yml @@ -149,7 +148,6 @@ jobs: echo "Running the CMS migrations." ./manage.py cms showmigrations - # 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 From 4bbdeffbceb5c2005de2b868d6043a029a343ab7 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 18:35:15 +0500 Subject: [PATCH 011/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 41d0b4a329fb..d44405a72a1e 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -119,9 +119,13 @@ jobs: STUDIO_CFG: lms/envs/minimal.yml run: | echo "Running the LMS migrations." - ./manage.py lms showmigrations + ./manage.py lms migrate echo "Running the CMS migrations." - ./manage.py cms showmigrations + ./manage.py cms migrate + + - name: Verify executed migrations on master. + run: | + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations ;" edxapp - name: Checkout branch repo uses: actions/checkout@v2 @@ -148,6 +152,11 @@ jobs: echo "Running the CMS migrations." ./manage.py cms showmigrations + - name: Verify executed migrations on branch. + run: | + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations ;" edxapp + + # 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 From 3a7edb7487e707aee6a08aca271e27eed6023f4a Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 19:03:48 +0500 Subject: [PATCH 012/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index d44405a72a1e..355a8ecbfa19 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -108,10 +108,6 @@ jobs: pip check # fail if this test-reqs/Django combination is broken fi - - name: list installed package versions - run: | - pip freeze - - name: Run Tests env: LMS_CFG: lms/envs/minimal.yml From 26f4dc1415764905d0ad6623866afdf7f1be8ff3 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 19:06:56 +0500 Subject: [PATCH 013/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 355a8ecbfa19..178ba58441e1 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -119,9 +119,9 @@ jobs: echo "Running the CMS migrations." ./manage.py cms migrate - - name: Verify executed migrations on master. - run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations ;" edxapp + - name: Verify executed migrations on master. + run: | + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations ;" edxapp - name: Checkout branch repo uses: actions/checkout@v2 From 8d3e915bd1181954d4d0722a98c7fb5c60cf46e7 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 19:30:16 +0500 Subject: [PATCH 014/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 178ba58441e1..552eaec133a9 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -115,9 +115,9 @@ jobs: STUDIO_CFG: lms/envs/minimal.yml run: | echo "Running the LMS migrations." - ./manage.py lms migrate + ./manage.py lms showmigrations echo "Running the CMS migrations." - ./manage.py cms migrate + ./manage.py cms showmigrations - name: Verify executed migrations on master. run: | From ec1e12eef35a7a38bef920b34180f4f20b8757a2 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 19:35:06 +0500 Subject: [PATCH 015/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 552eaec133a9..d32c59d9f4bb 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -121,7 +121,7 @@ jobs: - name: Verify executed migrations on master. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations ;" edxapp + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp - name: Checkout branch repo uses: actions/checkout@v2 @@ -150,7 +150,7 @@ jobs: - name: Verify executed migrations on branch. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations ;" edxapp + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp # This job aggregates test results. It's the required check for branch protection. From d9a053df323d5a3d258ed36f13d4b19358f6d1d2 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 20:23:12 +0500 Subject: [PATCH 016/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index d32c59d9f4bb..206c340236b2 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -115,13 +115,13 @@ jobs: STUDIO_CFG: lms/envs/minimal.yml run: | echo "Running the LMS migrations." - ./manage.py lms showmigrations + ./manage.py lms migrate echo "Running the CMS migrations." - ./manage.py cms showmigrations + ./manage.py cms migrate - name: Verify executed migrations on master. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp; "select app,name from django_migrations;"; - name: Checkout branch repo uses: actions/checkout@v2 @@ -144,13 +144,13 @@ jobs: STUDIO_CFG: lms/envs/minimal.yml run: | echo "Running the LMS migrations." - ./manage.py lms showmigrations + ./manage.py lms migrate echo "Running the CMS migrations." - ./manage.py cms showmigrations + ./manage.py cms migrate - name: Verify executed migrations on branch. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp; "select app,name from django_migrations;"; # This job aggregates test results. It's the required check for branch protection. From 450df4b48fc95e873015df78e12b5388a963eb03 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 20:48:48 +0500 Subject: [PATCH 017/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 206c340236b2..b1d512e77cfd 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -121,7 +121,7 @@ jobs: - name: Verify executed migrations on master. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp; "select app,name from django_migrations;"; + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app,name from django_migrations; ;" edxapp; - name: Checkout branch repo uses: actions/checkout@v2 @@ -150,7 +150,7 @@ jobs: - name: Verify executed migrations on branch. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp; "select app,name from django_migrations;"; + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app,name from django_migrations; ;" edxapp; # This job aggregates test results. It's the required check for branch protection. From a9d0efca5876ed22028a1de5f0c2e5ed9a65466a Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 22:46:25 +0500 Subject: [PATCH 018/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index b1d512e77cfd..1dbea1064e12 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -121,7 +121,7 @@ jobs: - name: Verify executed migrations on master. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app,name from django_migrations; ;" edxapp; + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp; - name: Checkout branch repo uses: actions/checkout@v2 @@ -150,7 +150,7 @@ jobs: - name: Verify executed migrations on branch. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app,name from django_migrations; ;" edxapp; + mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp; # This job aggregates test results. It's the required check for branch protection. From 799da94147e33abe8c6e781a99061c567c488620 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 30 Oct 2023 23:54:40 +0500 Subject: [PATCH 019/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 1dbea1064e12..f74da07b65fd 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -121,7 +121,10 @@ jobs: - name: Verify executed migrations on master. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp; + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp; | tail -n 1) + echo "Query Result: $query_result" + echo "::set-env name=MYSQL_QUERY_RESULT::$query_result" + shell: bash - name: Checkout branch repo uses: actions/checkout@v2 @@ -150,7 +153,10 @@ jobs: - name: Verify executed migrations on branch. run: | - mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp; + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp; | tail -n 1) + echo "Query Result: $query_result" + echo "::set-env name=MYSQL_QUERY_RESULT::$query_result" + shell: bash # This job aggregates test results. It's the required check for branch protection. From aba47373b1687f7d830502149ae826a9a21c8a8a Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 00:14:13 +0500 Subject: [PATCH 020/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index f74da07b65fd..971f829940b4 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -121,9 +121,9 @@ jobs: - name: Verify executed migrations on master. run: | - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp; | tail -n 1) + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: $query_result" - echo "::set-env name=MYSQL_QUERY_RESULT::$query_result" + echo "$query_result" shell: bash - name: Checkout branch repo @@ -153,9 +153,9 @@ jobs: - name: Verify executed migrations on branch. run: | - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp; | tail -n 1) + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: $query_result" - echo "::set-env name=MYSQL_QUERY_RESULT::$query_result" + echo "$query_result" shell: bash From cf48e69fdaff4a0f2028b839ccdbf29a1a34c75d Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 00:32:53 +0500 Subject: [PATCH 021/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 971f829940b4..813c755bfcf2 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -153,9 +153,17 @@ jobs: - name: Verify executed migrations on branch. run: | - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - echo "Query Result: $query_result" - echo "$query_result" + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + echo "Query Result: $query_result1" + echo "$query_result1" + shell: bash + + - name: Verify difference + run: | + diff = $query_result1 - $query_result + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) + echo "Query Result: result" + echo "result" shell: bash From 75ed7778f03ce7b2335583381148c5fc718b596f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 00:56:38 +0500 Subject: [PATCH 022/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 813c755bfcf2..b9168627df6a 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -162,8 +162,8 @@ jobs: run: | diff = $query_result1 - $query_result result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) - echo "Query Result: result" - echo "result" + echo "Query Result: $result" + echo "$result" shell: bash From 8124279f4cc45a411f11156b8ee29b78c146abcd Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 01:16:00 +0500 Subject: [PATCH 023/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index b9168627df6a..f037e91c282a 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -18,7 +18,7 @@ jobs: # 'pinned' is used to install the latest patch version of Django # within the global constraint i.e. Django==3.2.21 in current case # because we have global constraint of Django<4.2 - django-version: ["pinned", "4.2"] + django-version: ["4.2"] mongo-version: ["4"] mysql-version: ["8"] # excluding mysql5.7 with Django 4.2 since Django 4.2 has @@ -160,7 +160,10 @@ jobs: - name: Verify difference run: | - diff = $query_result1 - $query_result + number1=$query_result1 + number2=$query_result + # Perform subtraction + diff=$((number1 - number2)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) echo "Query Result: $result" echo "$result" From cfd565e7d9930002abfb968f78715d0399177e38 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 12:06:10 +0500 Subject: [PATCH 024/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index f037e91c282a..bd294251251d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -120,6 +120,7 @@ jobs: ./manage.py cms migrate - name: Verify executed migrations on master. + id: capture1 run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: $query_result" @@ -152,6 +153,7 @@ jobs: ./manage.py cms migrate - name: Verify executed migrations on branch. + id: capture2 run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: $query_result1" @@ -160,8 +162,8 @@ jobs: - name: Verify difference run: | - number1=$query_result1 - number2=$query_result + number1=${{ steps.capture2.outputs.query_result1 }} + number2=${{ steps.capture1.outputs.query_result }} # Perform subtraction diff=$((number1 - number2)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) From 4cbff6b3855fa3a0f250bcc4af905b46bbb05c69 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 12:41:20 +0500 Subject: [PATCH 025/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index bd294251251d..8e617328a43c 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -162,8 +162,8 @@ jobs: - name: Verify difference run: | - number1=${{ steps.capture2.outputs.query_result1 }} - number2=${{ steps.capture1.outputs.query_result }} + number1=${{ steps.capture2.query_result1 }} + number2=${{ steps.capture1.query_result }} # Perform subtraction diff=$((number1 - number2)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) From 0889070de8256231b98c40d33c027d365ea8ab6f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 13:07:19 +0500 Subject: [PATCH 026/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 8e617328a43c..466a0a60d7ef 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -124,7 +124,8 @@ jobs: run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: $query_result" - echo "$query_result" + echo "query_result=${query_result}" >> $GITHUB_ENV + echo "echo ${{env.query_result}}" shell: bash - name: Checkout branch repo @@ -156,14 +157,17 @@ jobs: id: capture2 run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - echo "Query Result: $query_result1" - echo "$query_result1" + echo "Query Result: query_result1" + echo "query_result1=${query_result1}" >> $GITHUB_ENV + echo "echo ${{env.query_result1}}" shell: bash - name: Verify difference run: | - number1=${{ steps.capture2.query_result1 }} - number2=${{ steps.capture1.query_result }} + echo "echo ${{env.query_result}}" + echo "echo ${{env.query_result1}}" + number1=${{ env.query_result1 }} + number2=${{ env.query_result1 }} # Perform subtraction diff=$((number1 - number2)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) From 61b457508d5df39c6e1e5387f257f5fbd356affd Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 13:37:27 +0500 Subject: [PATCH 027/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 466a0a60d7ef..cbfdba171d03 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -124,7 +124,7 @@ jobs: run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: $query_result" - echo "query_result=${query_result}" >> $GITHUB_ENV + echo "${query_result}" >> $GITHUB_ENV echo "echo ${{env.query_result}}" shell: bash @@ -158,7 +158,7 @@ jobs: run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: query_result1" - echo "query_result1=${query_result1}" >> $GITHUB_ENV + echo "${query_result1}" >> $GITHUB_ENV echo "echo ${{env.query_result1}}" shell: bash From ad9e64f89422e1057cc818f99038bf91290de804 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 14:04:34 +0500 Subject: [PATCH 028/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index cbfdba171d03..466a0a60d7ef 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -124,7 +124,7 @@ jobs: run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: $query_result" - echo "${query_result}" >> $GITHUB_ENV + echo "query_result=${query_result}" >> $GITHUB_ENV echo "echo ${{env.query_result}}" shell: bash @@ -158,7 +158,7 @@ jobs: run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "Query Result: query_result1" - echo "${query_result1}" >> $GITHUB_ENV + echo "query_result1=${query_result1}" >> $GITHUB_ENV echo "echo ${{env.query_result1}}" shell: bash From 47b0b6ef1980d67527f4429f2823f661152e8627 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 14:18:58 +0500 Subject: [PATCH 029/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 466a0a60d7ef..869bb2afa4bd 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -123,9 +123,8 @@ jobs: id: capture1 run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - echo "Query Result: $query_result" - echo "query_result=${query_result}" >> $GITHUB_ENV - echo "echo ${{env.query_result}}" + echo "Query Result: query_result" + echo "query_result=query_result" >> $GITHUB_ENV shell: bash - name: Checkout branch repo @@ -157,9 +156,8 @@ jobs: id: capture2 run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - echo "Query Result: query_result1" - echo "query_result1=${query_result1}" >> $GITHUB_ENV - echo "echo ${{env.query_result1}}" + echo "Query Result: $query_result1" + echo "query_result1=$query_result1" >> $GITHUB_ENV shell: bash - name: Verify difference From 1a641d1572f2fd9c0eb4b7c535b79cfa7e7a09d0 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 14:32:05 +0500 Subject: [PATCH 030/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 869bb2afa4bd..fb87c77c28eb 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -141,6 +141,34 @@ jobs: - name: list installed package versions run: | pip freeze + + - name: Verify executed migrations on branch. + id: capture2 + run: | + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) + echo "Query Result: $query_result1" + echo "query_result1=$query_result1" >> $GITHUB_ENV + + - name: Verify executed migrations on branch2. + id: capture2 + run: | + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) + echo "Query Result: $query_result1" + echo "query_result1=$query_result1" >> $GITHUB_ENV + + - name: Verify difference + run: | + echo "echo ${{env.query_result}}" + echo "echo ${{env.query_result1}}" + number1=${{ env.query_result1 }} + number2=${{ env.query_result1 }} + # Perform subtraction + diff=$((number1 - number2)) + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) + echo "Query Result: $result" + echo "$result" + + - name: Run Tests env: LMS_CFG: lms/envs/minimal.yml From 0b94e4b7cfeaba6f9838f721336c9e388ed4f94d Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 14:45:12 +0500 Subject: [PATCH 031/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 54 ++++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index fb87c77c28eb..91adc930ff28 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -108,6 +108,33 @@ jobs: pip check # fail if this test-reqs/Django combination is broken fi + - name: Verify executed migrations on branch. + id: capture2 + run: | + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) + echo "Query Result: $query_result1" + echo "query_result1=$query_result1" >> $GITHUB_ENV + + - name: Verify executed migrations on branch2. + id: capture2 + run: | + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) + echo "Query Result: $query_result1" + echo "query_result1=$query_result1" >> $GITHUB_ENV + + - name: Verify difference + run: | + echo "echo ${{env.query_result}}" + echo "echo ${{env.query_result1}}" + number1=${{ env.query_result1 }} + number2=${{ env.query_result1 }} + # Perform subtraction + diff=$((number1 - number2)) + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) + echo "Query Result: $result" + echo "$result" + + - name: Run Tests env: LMS_CFG: lms/envs/minimal.yml @@ -142,33 +169,6 @@ jobs: run: | pip freeze - - name: Verify executed migrations on branch. - id: capture2 - run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "Query Result: $query_result1" - echo "query_result1=$query_result1" >> $GITHUB_ENV - - - name: Verify executed migrations on branch2. - id: capture2 - run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "Query Result: $query_result1" - echo "query_result1=$query_result1" >> $GITHUB_ENV - - - name: Verify difference - run: | - echo "echo ${{env.query_result}}" - echo "echo ${{env.query_result1}}" - number1=${{ env.query_result1 }} - number2=${{ env.query_result1 }} - # Perform subtraction - diff=$((number1 - number2)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) - echo "Query Result: $result" - echo "$result" - - - name: Run Tests env: LMS_CFG: lms/envs/minimal.yml From b8d90a7f3422bb74b566d403e743600e43f7cd00 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:01:42 +0500 Subject: [PATCH 032/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 76 +++++++------------- 1 file changed, 25 insertions(+), 51 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 91adc930ff28..c464cb03dec9 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -108,50 +108,24 @@ jobs: pip check # fail if this test-reqs/Django combination is broken fi - - name: Verify executed migrations on branch. - id: capture2 - run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "Query Result: $query_result1" - echo "query_result1=$query_result1" >> $GITHUB_ENV - - - name: Verify executed migrations on branch2. - id: capture2 - run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "Query Result: $query_result1" - echo "query_result1=$query_result1" >> $GITHUB_ENV - - - name: Verify difference - run: | - echo "echo ${{env.query_result}}" - echo "echo ${{env.query_result1}}" - number1=${{ env.query_result1 }} - number2=${{ env.query_result1 }} - # Perform subtraction - diff=$((number1 - number2)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) - echo "Query Result: $result" - echo "$result" - - - - 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 - name: Verify executed migrations on master. id: capture1 run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - echo "Query Result: query_result" - echo "query_result=query_result" >> $GITHUB_ENV + echo "Query Result: $query_result" + echo "query_result=${query_result}" >> $GITHUB_ENV + echo "echo ${{env.query_result}}" shell: bash - name: Checkout branch repo @@ -169,23 +143,23 @@ jobs: run: | 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 - name: Verify executed migrations on branch. id: capture2 run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - echo "Query Result: $query_result1" - echo "query_result1=$query_result1" >> $GITHUB_ENV + echo "Query Result: query_result1" + echo "query_result1=${query_result1}" >> $GITHUB_ENV shell: bash - name: Verify difference From 9c374335351234dd99d982ce553bca3440d4737d Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:06:09 +0500 Subject: [PATCH 033/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index c464cb03dec9..4340a42bd82e 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -122,7 +122,7 @@ jobs: - name: Verify executed migrations on master. id: capture1 run: | - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) echo "Query Result: $query_result" echo "query_result=${query_result}" >> $GITHUB_ENV echo "echo ${{env.query_result}}" @@ -157,7 +157,7 @@ jobs: - name: Verify executed migrations on branch. id: capture2 run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) echo "Query Result: query_result1" echo "query_result1=${query_result1}" >> $GITHUB_ENV shell: bash @@ -170,7 +170,7 @@ jobs: number2=${{ env.query_result1 }} # Perform subtraction diff=$((number1 - number2)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff ;" edxapp;) + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) echo "Query Result: $result" echo "$result" shell: bash From 9868d8fbdfa1df6a5419466284bdabbf5dd54d36 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:12:54 +0500 Subject: [PATCH 034/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 4340a42bd82e..00669550c48a 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -124,24 +124,24 @@ jobs: run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) echo "Query Result: $query_result" - echo "query_result=${query_result}" >> $GITHUB_ENV + echo "query_result=$query_result" >> $GITHUB_ENV echo "echo ${{env.query_result}}" shell: bash - name: Checkout branch repo uses: actions/checkout@v2 - - 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: | - pip freeze +# - 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: | +# pip freeze # - name: Run Tests # env: From 6725df011e71e93d1cd88266940a8230440fa677 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:20:35 +0500 Subject: [PATCH 035/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 00669550c48a..eb3e97b61f40 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -125,7 +125,6 @@ jobs: query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) echo "Query Result: $query_result" echo "query_result=$query_result" >> $GITHUB_ENV - echo "echo ${{env.query_result}}" shell: bash - name: Checkout branch repo @@ -157,10 +156,11 @@ jobs: - name: Verify executed migrations on branch. id: capture2 run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "Query Result: query_result1" - echo "query_result1=${query_result1}" >> $GITHUB_ENV - shell: bash + echo " ${{env.query_result}}" +# query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) +# echo "Query Result: query_result1" +# echo "query_result1=${query_result1}" >> $GITHUB_ENV +# shell: bash - name: Verify difference run: | From 01e8e3597758fc6f8edf3d57356f1db041647f35 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:26:26 +0500 Subject: [PATCH 036/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 31 ++++++++++---------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index eb3e97b61f40..d310a0eaa3bc 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -92,20 +92,20 @@ jobs: 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 +# - 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: Run Tests @@ -156,7 +156,8 @@ jobs: - name: Verify executed migrations on branch. id: capture2 run: | - echo " ${{env.query_result}}" + captured_result="${{ env.query_result }}" + echo "Captured Output: $captured_result" # query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) # echo "Query Result: query_result1" # echo "query_result1=${query_result1}" >> $GITHUB_ENV From ecd2762d776da73e4059d77388bc9456a0ffbd73 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:29:03 +0500 Subject: [PATCH 037/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index d310a0eaa3bc..621a57f80507 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -82,15 +82,15 @@ jobs: 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: 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 From 206c06095fd09eef3f391867c4b6533ed4509bde Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:35:06 +0500 Subject: [PATCH 038/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 621a57f80507..83af95c5b691 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -106,7 +106,7 @@ jobs: # 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 +# fi # - name: Run Tests # env: From 1a2d51ba8bc9fa64a4617689f0491cc4ea1b0b07 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:49:34 +0500 Subject: [PATCH 039/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 83af95c5b691..50ac2be9b2c9 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -124,7 +124,7 @@ jobs: run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) echo "Query Result: $query_result" - echo "query_result=$query_result" >> $GITHUB_ENV + echo "query_r=$query_result" >> $GITHUB_ENV shell: bash - name: Checkout branch repo @@ -156,7 +156,7 @@ jobs: - name: Verify executed migrations on branch. id: capture2 run: | - captured_result="${{ env.query_result }}" + captured_result="${{ env.query_r }}" echo "Captured Output: $captured_result" # query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) # echo "Query Result: query_result1" From 70dd4e03c5c903f57c479559c85ba25d9a5bd259 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 15:57:40 +0500 Subject: [PATCH 040/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 50ac2be9b2c9..337a5c0e5e64 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -53,6 +53,14 @@ jobs: --health-timeout 5s --health-retries 3 steps: + - name: Step 1 + run: | + echo "action_state=yellow" >> $GITHUB_ENV + echo "State is: '${{ env.action_state }}'" + - name: Step 2 + run: | + echo "State is: '${{ env.action_state }}'" + - name: Setup mongodb user run: | mongosh edxapp --eval ' @@ -121,11 +129,11 @@ jobs: - name: Verify executed migrations on master. id: capture1 + shell: bash run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) echo "Query Result: $query_result" echo "query_r=$query_result" >> $GITHUB_ENV - shell: bash - name: Checkout branch repo uses: actions/checkout@v2 @@ -154,6 +162,7 @@ jobs: # ./manage.py cms migrate - name: Verify executed migrations on branch. + shell: bash id: capture2 run: | captured_result="${{ env.query_r }}" From 2b33ce33595522ad3e8d679f46e3f913c997e9d6 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 16:01:46 +0500 Subject: [PATCH 041/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 337a5c0e5e64..fd1635b85efc 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -53,13 +53,13 @@ jobs: --health-timeout 5s --health-retries 3 steps: - - name: Step 1 - run: | - echo "action_state=yellow" >> $GITHUB_ENV - echo "State is: '${{ env.action_state }}'" - - name: Step 2 - run: | - echo "State is: '${{ env.action_state }}'" + - name: Step 1 + run: | + echo "action_state=yellow" >> $GITHUB_ENV + echo "State is: '${{ env.action_state }}'" + - name: Step 2 + run: | + echo "State is: '${{ env.action_state }}'" - name: Setup mongodb user run: | From 464c0f6f754fdf6821004e456d84e75657afb78b Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 16:05:47 +0500 Subject: [PATCH 042/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index fd1635b85efc..ed61058f6e63 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -53,14 +53,6 @@ jobs: --health-timeout 5s --health-retries 3 steps: - - name: Step 1 - run: | - echo "action_state=yellow" >> $GITHUB_ENV - echo "State is: '${{ env.action_state }}'" - - name: Step 2 - run: | - echo "State is: '${{ env.action_state }}'" - - name: Setup mongodb user run: | mongosh edxapp --eval ' @@ -135,6 +127,14 @@ jobs: echo "Query Result: $query_result" echo "query_r=$query_result" >> $GITHUB_ENV +# - name: Step 1 +# run: | +# echo "action_state=yellow" >> $GITHUB_ENV +# echo "State is: '${{ env.action_state }}'" + - name: Step 2 + run: | + echo "State is: '${{ env.query_r }}'" + - name: Checkout branch repo uses: actions/checkout@v2 From c1a06bcaeb2c5064a0c0c8579d03bcfe636d323e Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 16:11:03 +0500 Subject: [PATCH 043/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index ed61058f6e63..ec4c2e0cadee 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -125,7 +125,7 @@ jobs: run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) echo "Query Result: $query_result" - echo "query_r=$query_result" >> $GITHUB_ENV + echo "VALUE1=$query_result" >> $GITHUB_ENV # - name: Step 1 # run: | @@ -133,7 +133,7 @@ jobs: # echo "State is: '${{ env.action_state }}'" - name: Step 2 run: | - echo "State is: '${{ env.query_r }}'" + echo "State is: '${{ env.VALUE1 }}'" - name: Checkout branch repo uses: actions/checkout@v2 From a573f2fa5637cbd898bbc4273c58097afce359c5 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 16:22:14 +0500 Subject: [PATCH 044/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index ec4c2e0cadee..b4f754eafec3 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -127,11 +127,7 @@ jobs: echo "Query Result: $query_result" echo "VALUE1=$query_result" >> $GITHUB_ENV -# - name: Step 1 -# run: | -# echo "action_state=yellow" >> $GITHUB_ENV -# echo "State is: '${{ env.action_state }}'" - - name: Step 2 + - name: Step 1 run: | echo "State is: '${{ env.VALUE1 }}'" From 01634fe9cab8893bf05d52cdd256664510d84287 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 16:51:07 +0500 Subject: [PATCH 045/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index b4f754eafec3..7ce18fd3e651 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -123,7 +123,7 @@ jobs: id: capture1 shell: bash run: | - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) + query_result="yellow" echo "Query Result: $query_result" echo "VALUE1=$query_result" >> $GITHUB_ENV From 4a0dc062eabd3a066641075144ca10386f05559f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 16:56:56 +0500 Subject: [PATCH 046/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 7ce18fd3e651..8055bd168b94 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -123,9 +123,7 @@ jobs: id: capture1 shell: bash run: | - query_result="yellow" - echo "Query Result: $query_result" - echo "VALUE1=$query_result" >> $GITHUB_ENV + echo "$query_result=yellow" >> $GITHUB_ENV - name: Step 1 run: | From 7c75eb29681fee37787484df51509e29ae2d809f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 16:58:46 +0500 Subject: [PATCH 047/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 8055bd168b94..7096928e7fbf 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -123,11 +123,11 @@ jobs: id: capture1 shell: bash run: | - echo "$query_result=yellow" >> $GITHUB_ENV + echo "query_result=yellow" >> $GITHUB_ENV - name: Step 1 run: | - echo "State is: '${{ env.VALUE1 }}'" + echo "State is: '${{ env.query_result }}'" - name: Checkout branch repo uses: actions/checkout@v2 From c5af3c2512b5848ca2c941c7157346b18b1895d0 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 17:02:22 +0500 Subject: [PATCH 048/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 7096928e7fbf..ca3e9adc1626 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -123,7 +123,8 @@ jobs: id: capture1 shell: bash run: | - echo "query_result=yellow" >> $GITHUB_ENV + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) + echo "query_result=query_result1" >> $GITHUB_ENV - name: Step 1 run: | From 9c2dfc50f40be81d120e758f8252d4b68fbb1524 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 17:05:35 +0500 Subject: [PATCH 049/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index ca3e9adc1626..0366ac316645 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -124,7 +124,7 @@ jobs: shell: bash run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "query_result=query_result1" >> $GITHUB_ENV + echo "query_result=${query_result1}" >> $GITHUB_ENV - name: Step 1 run: | From 40bec3ff13ea8319a45f697a1120be68aa9d5a97 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 17:12:13 +0500 Subject: [PATCH 050/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 0366ac316645..c599c6113a1d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -119,6 +119,11 @@ jobs: # echo "Running the CMS migrations." # ./manage.py cms migrate + - id: step1 + run: echo "stepOutput=value" >> "$GITHUB_OUTPUT" + - id: step2 + run: echo "${{ steps.step1.stepOutput }}" + - name: Verify executed migrations on master. id: capture1 shell: bash From 2819758082b48e1a42e18778cd27e6fa387eca90 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 17:36:32 +0500 Subject: [PATCH 051/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index c599c6113a1d..d501f1d627b1 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -119,10 +119,18 @@ jobs: # echo "Running the CMS migrations." # ./manage.py cms migrate - - id: step1 - run: echo "stepOutput=value" >> "$GITHUB_OUTPUT" - - id: step2 - run: echo "${{ steps.step1.stepOutput }}" + - name: "Setup env vars" + id: envvars + run: | + echo "TEST_VAR=$TEST_VAR" >> $GITHUB_OUTPUT + echo "SERVICE_NAME=$SERVICE_NAME" >> $GITHUB_OUTPUT + env: + TEST_VAR: "test variable value" + + - name: "Var is " + run: | + echo "${{ steps.envvars.outputs.TEST_VAR }}" + echo "${{ steps.envvars.outputs.SERVICE_NAME }}" - name: Verify executed migrations on master. id: capture1 From a1eca1df7e5e3b666aeec20736d7175bfbc17629 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 17:48:35 +0500 Subject: [PATCH 052/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index d501f1d627b1..97fd2942f01e 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -122,7 +122,7 @@ jobs: - name: "Setup env vars" id: envvars run: | - echo "TEST_VAR=$TEST_VAR" >> $GITHUB_OUTPUT + echo "TEST_VAR='aaaa'" >> $GITHUB_OUTPUT echo "SERVICE_NAME=$SERVICE_NAME" >> $GITHUB_OUTPUT env: TEST_VAR: "test variable value" From a793a3f4fab77488e0998160088c6e69d51b00e6 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 17:57:35 +0500 Subject: [PATCH 053/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 97fd2942f01e..0dff136bdf59 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -122,15 +122,20 @@ jobs: - name: "Setup env vars" id: envvars run: | - echo "TEST_VAR='aaaa'" >> $GITHUB_OUTPUT - echo "SERVICE_NAME=$SERVICE_NAME" >> $GITHUB_OUTPUT - env: - TEST_VAR: "test variable value" + number1=10 + number2=5 + echo "Number 1: $number1" + echo "Number 2: $number2" + result=$((number1 - number2)) + echo "Result: $result" + echo "::set-env name=SUBTRACTION_RESULT::$result" + shell: bash + - - name: "Var is " + - name: Use subtraction result run: | - echo "${{ steps.envvars.outputs.TEST_VAR }}" - echo "${{ steps.envvars.outputs.SERVICE_NAME }}" + subtraction_result=${{ env.SUBTRACTION_RESULT }} + echo "Subtraction Result: $subtraction_result" - name: Verify executed migrations on master. id: capture1 From 2a710e655b364958ef40c4312ed2da745b98821b Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 18:03:37 +0500 Subject: [PATCH 054/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 0dff136bdf59..22fd5b46d288 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -128,10 +128,9 @@ jobs: echo "Number 2: $number2" result=$((number1 - number2)) echo "Result: $result" - echo "::set-env name=SUBTRACTION_RESULT::$result" + echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV shell: bash - - name: Use subtraction result run: | subtraction_result=${{ env.SUBTRACTION_RESULT }} From ec0d51dc124c0db4a99aa6e5adb852f108079f3c Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 18:13:25 +0500 Subject: [PATCH 055/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 22fd5b46d288..12cc19c78584 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -141,11 +141,11 @@ jobs: shell: bash run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "query_result=${query_result1}" >> $GITHUB_ENV + echo "FIRST_QUERY=query_result1" >> $GITHUB_ENV - - name: Step 1 + - name: Step 12 run: | - echo "State is: '${{ env.query_result }}'" + echo "State is: '${{ env.FIRST_QUERY }}'" - name: Checkout branch repo uses: actions/checkout@v2 From da9a59b8983bb43799485640da16d30d7ee28db1 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 18:17:34 +0500 Subject: [PATCH 056/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 12cc19c78584..ef7ac388bd8c 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -145,7 +145,8 @@ jobs: - name: Step 12 run: | - echo "State is: '${{ env.FIRST_QUERY }}'" + subtraction_result=${{ env.FIRST_QUERY }} + echo "State is: subtraction_result" - name: Checkout branch repo uses: actions/checkout@v2 From 1157b6eeed9462edffd0b0cd9e9be2ec73c0632a Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 18:20:10 +0500 Subject: [PATCH 057/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index ef7ac388bd8c..a1aa8cb95b65 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -141,7 +141,7 @@ jobs: shell: bash run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "FIRST_QUERY=query_result1" >> $GITHUB_ENV + echo "FIRST_QUERY=$query_result1" >> $GITHUB_ENV - name: Step 12 run: | From be46807a2bd592217791cdaf39682cffda6f9334 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 18:24:46 +0500 Subject: [PATCH 058/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index a1aa8cb95b65..b197c11fd67f 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -141,7 +141,8 @@ jobs: shell: bash run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - echo "FIRST_QUERY=$query_result1" >> $GITHUB_ENV + numeric_result = $(echo "$query_result" | tr -d '[:space:]') + echo "FIRST_QUERY=numeric_result" >> $GITHUB_ENV - name: Step 12 run: | From 2d4fc6f1280878dc73cbe502f5bf0554ac4c0d20 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 18:27:17 +0500 Subject: [PATCH 059/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index b197c11fd67f..c4e43d2073f1 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -142,7 +142,7 @@ jobs: run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) numeric_result = $(echo "$query_result" | tr -d '[:space:]') - echo "FIRST_QUERY=numeric_result" >> $GITHUB_ENV + echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV - name: Step 12 run: | From 1bdb0a3e1be92f49944bfc7b2d896d2ea7a1ea2f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 18:30:32 +0500 Subject: [PATCH 060/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index c4e43d2073f1..0bc073e2dc65 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -141,7 +141,8 @@ jobs: shell: bash run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - numeric_result = $(echo "$query_result" | tr -d '[:space:]') + numeric_result=$(echo "$query_result" | tr -d '[:space:]') + echo "Numeric Result: $numeric_result" echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV - name: Step 12 From 067fdf7dd01a23807afc49ee97cc3a7e336bd559 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 18:34:54 +0500 Subject: [PATCH 061/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 124 +++++++++---------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 0bc073e2dc65..15f8f3bb946c 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -82,59 +82,59 @@ jobs: 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: 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: Install system Packages + run: | + sudo apt-get update + make ubuntu-requirements - - name: "Setup env vars" - id: envvars + - name: Get pip cache dir + id: pip-cache-dir run: | - number1=10 - number2=5 - echo "Number 1: $number1" - echo "Number 2: $number2" - result=$((number1 - number2)) - echo "Result: $result" - echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV - shell: bash + 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: Use subtraction result + - 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: 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: | - subtraction_result=${{ env.SUBTRACTION_RESULT }} - echo "Subtraction Result: $subtraction_result" + echo "Running the LMS migrations." + ./manage.py lms migrate + echo "Running the CMS migrations." + ./manage.py cms migrate + +# - name: "Setup env vars" +# id: envvars +# run: | +# number1=10 +# number2=5 +# echo "Number 1: $number1" +# echo "Number 2: $number2" +# result=$((number1 - number2)) +# echo "Result: $result" +# echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV +# shell: bash +# +# - name: Use subtraction result +# run: | +# subtraction_result=${{ env.SUBTRACTION_RESULT }} +# echo "Subtraction Result: $subtraction_result" - name: Verify executed migrations on master. id: capture1 @@ -182,22 +182,22 @@ jobs: run: | captured_result="${{ env.query_r }}" echo "Captured Output: $captured_result" -# query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) -# echo "Query Result: query_result1" -# echo "query_result1=${query_result1}" >> $GITHUB_ENV -# shell: bash + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + numeric_result=$(echo "$query_result" | tr -d '[:space:]') + echo "Numeric Result: $numeric_result" + echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV - name: Verify difference run: | - echo "echo ${{env.query_result}}" - echo "echo ${{env.query_result1}}" - number1=${{ env.query_result1 }} - number2=${{ env.query_result1 }} - # Perform subtraction - diff=$((number1 - number2)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) - echo "Query Result: $result" - echo "$result" + echo "echo ${{env.FIRST_QUERY}}" +# echo "echo ${{env.query_result1}}" +# number1=${{ env.query_result1 }} +# number2=${{ env.query_result1 }} +# # Perform subtraction +# diff=$((number1 - number2)) +# result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) +# echo "Query Result: $result" +# echo "$result" shell: bash From aaf85b5cb670d68e9e16c8dd85075db9bd68dcea Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 19:05:49 +0500 Subject: [PATCH 062/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 73 +++++++++----------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 15f8f3bb946c..886005398dac 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -137,67 +137,60 @@ jobs: # echo "Subtraction Result: $subtraction_result" - name: Verify executed migrations on master. - id: capture1 + id: capture12 shell: bash run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - numeric_result=$(echo "$query_result" | tr -d '[:space:]') + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + numeric_result=$(echo "$query_result" | sed 's/[^0-9]*//g') echo "Numeric Result: $numeric_result" echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV - - name: Step 12 - run: | - subtraction_result=${{ env.FIRST_QUERY }} - echo "State is: subtraction_result" - - name: Checkout branch repo uses: actions/checkout@v2 -# - 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: | -# pip freeze + - name: list installed package versions + run: | + 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 - name: Verify executed migrations on branch. shell: bash id: capture2 run: | - captured_result="${{ env.query_r }}" - echo "Captured Output: $captured_result" - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - numeric_result=$(echo "$query_result" | tr -d '[:space:]') + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + numeric_result=$(echo "$query_result" | sed 's/[^0-9]*//g') echo "Numeric Result: $numeric_result" - echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV + echo "SECOND_QUERY=$numeric_result" >> $GITHUB_ENV - name: Verify difference run: | echo "echo ${{env.FIRST_QUERY}}" -# echo "echo ${{env.query_result1}}" -# number1=${{ env.query_result1 }} -# number2=${{ env.query_result1 }} + echo "echo ${{env.SECOND_QUERY}}" + number1=${{ env.FIRST_QUERY }} + number2=${{ env.SECOND_QUERY }} # # Perform subtraction -# diff=$((number1 - number2)) -# result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) -# echo "Query Result: $result" -# echo "$result" + diff=$((SECOND_QUERY - FIRST_QUERY)) + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit 3 ; ;" edxapp;) + echo "Query Result: $result" + echo "$result" shell: bash From 045d37541caeb567cabbe6622e5383883eb9d2b3 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 19:08:47 +0500 Subject: [PATCH 063/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 886005398dac..1f06f9a8726c 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -188,8 +188,7 @@ jobs: number2=${{ env.SECOND_QUERY }} # # Perform subtraction diff=$((SECOND_QUERY - FIRST_QUERY)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit 3 ; ;" edxapp;) - echo "Query Result: $result" + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit 3;" edxapp;) echo "$result" shell: bash From 351886c7fef72c5cc7e72d78baf83834e87575da Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 19:11:08 +0500 Subject: [PATCH 064/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 1f06f9a8726c..0df518f3ec6f 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -155,7 +155,7 @@ jobs: 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: | pip freeze @@ -173,7 +173,7 @@ jobs: - name: Verify executed migrations on branch. shell: bash - id: capture2 + id: capture23 run: | query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) numeric_result=$(echo "$query_result" | sed 's/[^0-9]*//g') From 438b39e61facaa08d51b6c35ffd6cc741abb0d3e Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 19:16:08 +0500 Subject: [PATCH 065/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 0df518f3ec6f..58bb770c6e03 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -192,7 +192,6 @@ jobs: echo "$result" shell: bash - # 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 From 22867113548cbb999ba463ae7b19fe13ca38fd06 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 19:21:54 +0500 Subject: [PATCH 066/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 24 +------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 58bb770c6e03..5401389718a9 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -119,23 +119,6 @@ jobs: echo "Running the CMS migrations." ./manage.py cms migrate -# - name: "Setup env vars" -# id: envvars -# run: | -# number1=10 -# number2=5 -# echo "Number 1: $number1" -# echo "Number 2: $number2" -# result=$((number1 - number2)) -# echo "Result: $result" -# echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV -# shell: bash -# -# - name: Use subtraction result -# run: | -# subtraction_result=${{ env.SUBTRACTION_RESULT }} -# echo "Subtraction Result: $subtraction_result" - - name: Verify executed migrations on master. id: capture12 shell: bash @@ -156,10 +139,6 @@ jobs: pip check # fail if this test-reqs/Django combination is broken fi - - name: list installed package versions - run: | - pip freeze - - name: Run Tests env: LMS_CFG: lms/envs/minimal.yml @@ -186,11 +165,10 @@ jobs: echo "echo ${{env.SECOND_QUERY}}" number1=${{ env.FIRST_QUERY }} number2=${{ env.SECOND_QUERY }} -# # Perform subtraction + # # Perform subtraction diff=$((SECOND_QUERY - FIRST_QUERY)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit 3;" edxapp;) echo "$result" - shell: bash # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why From 5387113a925631664c66928c31486e0d1dec85da Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 19:25:49 +0500 Subject: [PATCH 067/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 164 +++++++++++-------- 1 file changed, 97 insertions(+), 67 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 5401389718a9..c4e43d2073f1 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -82,93 +82,123 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install system Packages +# - 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: 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: "Setup env vars" + id: envvars 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- + number1=10 + number2=5 + echo "Number 1: $number1" + echo "Number 2: $number2" + result=$((number1 - number2)) + echo "Result: $result" + echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV + shell: bash - - 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: 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 + - name: Use subtraction result run: | - echo "Running the LMS migrations." - ./manage.py lms migrate - echo "Running the CMS migrations." - ./manage.py cms migrate + subtraction_result=${{ env.SUBTRACTION_RESULT }} + echo "Subtraction Result: $subtraction_result" - name: Verify executed migrations on master. - id: capture12 + id: capture1 shell: bash run: | - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - numeric_result=$(echo "$query_result" | sed 's/[^0-9]*//g') - echo "Numeric Result: $numeric_result" + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) + numeric_result = $(echo "$query_result" | tr -d '[:space:]') echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV + - name: Step 12 + run: | + subtraction_result=${{ env.FIRST_QUERY }} + echo "State is: subtraction_result" + - name: Checkout branch repo uses: actions/checkout@v2 - - 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: 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: 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: | +# 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: Verify executed migrations on branch. shell: bash - id: capture23 + id: capture2 run: | - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - numeric_result=$(echo "$query_result" | sed 's/[^0-9]*//g') - echo "Numeric Result: $numeric_result" - echo "SECOND_QUERY=$numeric_result" >> $GITHUB_ENV + captured_result="${{ env.query_r }}" + echo "Captured Output: $captured_result" +# query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) +# echo "Query Result: query_result1" +# echo "query_result1=${query_result1}" >> $GITHUB_ENV +# shell: bash - name: Verify difference run: | - echo "echo ${{env.FIRST_QUERY}}" - echo "echo ${{env.SECOND_QUERY}}" - number1=${{ env.FIRST_QUERY }} - number2=${{ env.SECOND_QUERY }} - # # Perform subtraction - diff=$((SECOND_QUERY - FIRST_QUERY)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit 3;" edxapp;) + echo "echo ${{env.query_result}}" + echo "echo ${{env.query_result1}}" + number1=${{ env.query_result1 }} + number2=${{ env.query_result1 }} + # Perform subtraction + diff=$((number1 - number2)) + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) + echo "Query Result: $result" echo "$result" + shell: bash + # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why From 6fbe2c4ec7ffe05b9bb0c87b2befa73732553b4e Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 22:05:13 +0500 Subject: [PATCH 068/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 111 ++++++++++--------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index c4e43d2073f1..5d546366f7cf 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -82,31 +82,31 @@ jobs: 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: 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: Run Tests # env: @@ -119,29 +119,30 @@ jobs: # echo "Running the CMS migrations." # ./manage.py cms migrate - - name: "Setup env vars" - id: envvars - run: | - number1=10 - number2=5 - echo "Number 1: $number1" - echo "Number 2: $number2" - result=$((number1 - number2)) - echo "Result: $result" - echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV - shell: bash - - - name: Use subtraction result - run: | - subtraction_result=${{ env.SUBTRACTION_RESULT }} - echo "Subtraction Result: $subtraction_result" +# - name: "Setup env vars" +# id: envvars +# run: | +# number1=10 +# number2=5 +# echo "Number 1: $number1" +# echo "Number 2: $number2" +# result=$((number1 - number2)) +# echo "Result: $result" +# echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV +# shell: bash +# +# - name: Use subtraction result +# run: | +# subtraction_result=${{ env.SUBTRACTION_RESULT }} +# echo "Subtraction Result: $subtraction_result" - name: Verify executed migrations on master. id: capture1 shell: bash run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - numeric_result = $(echo "$query_result" | tr -d '[:space:]') + numeric_result=$(echo "$query_result" | tr -d '[:space:]') + echo "Numeric Result: $numeric_result" echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV - name: Step 12 @@ -181,22 +182,22 @@ jobs: run: | captured_result="${{ env.query_r }}" echo "Captured Output: $captured_result" -# query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) -# echo "Query Result: query_result1" -# echo "query_result1=${query_result1}" >> $GITHUB_ENV -# shell: bash + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + numeric_result=$(echo "$query_result" | tr -d '[:space:]') + echo "Numeric Result: $numeric_result" + echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV - name: Verify difference run: | - echo "echo ${{env.query_result}}" - echo "echo ${{env.query_result1}}" - number1=${{ env.query_result1 }} - number2=${{ env.query_result1 }} - # Perform subtraction - diff=$((number1 - number2)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) - echo "Query Result: $result" - echo "$result" + echo "echo ${{env.FIRST_QUERY}}" +# echo "echo ${{env.query_result1}}" +# number1=${{ env.query_result1 }} +# number2=${{ env.query_result1 }} +# # Perform subtraction +# diff=$((number1 - number2)) +# result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) +# echo "Query Result: $result" +# echo "$result" shell: bash From 2198e8b2003d8e7539e1ac6434ff9bcb8ca78c7c Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 22:09:01 +0500 Subject: [PATCH 069/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 5d546366f7cf..5dd4c8494397 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -92,21 +92,21 @@ jobs: 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: 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: Run Tests # env: @@ -140,8 +140,8 @@ jobs: id: capture1 shell: bash run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - numeric_result=$(echo "$query_result" | tr -d '[:space:]') + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;;" edxapp;) + numeric_result=$(echo "$query_result" | sed 's/[^0-9]*//g') echo "Numeric Result: $numeric_result" echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV From 34ae3c44541a9018a44224572b5e305dd636102e Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 22:11:49 +0500 Subject: [PATCH 070/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 50 ++++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 5dd4c8494397..4fe11eed068a 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -92,32 +92,32 @@ jobs: 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: 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: 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: 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: 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: "Setup env vars" # id: envvars From bd439a1a08a44b0a2774b1cd714213c1ff1a70f2 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 22:28:22 +0500 Subject: [PATCH 071/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 4fe11eed068a..2b31c7ea3d82 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -116,8 +116,8 @@ jobs: run: | echo "Running the LMS migrations." ./manage.py lms migrate - echo "Running the CMS migrations." - ./manage.py cms migrate +# echo "Running the CMS migrations." +# ./manage.py cms migrate # - name: "Setup env vars" # id: envvars @@ -141,7 +141,7 @@ jobs: shell: bash run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;;" edxapp;) - numeric_result=$(echo "$query_result" | sed 's/[^0-9]*//g') + numeric_result=$(echo "query_result1" | sed 's/[^0-9]*//g') echo "Numeric Result: $numeric_result" echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV From f3ff04dac3b18d14acd1eb6075e1f9afbb9ef764 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 22:45:26 +0500 Subject: [PATCH 072/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 2b31c7ea3d82..f23eb3756174 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -115,7 +115,7 @@ jobs: STUDIO_CFG: lms/envs/minimal.yml run: | echo "Running the LMS migrations." - ./manage.py lms migrate + ./manage.py lms migrate social_django # echo "Running the CMS migrations." # ./manage.py cms migrate @@ -140,7 +140,8 @@ jobs: id: capture1 shell: bash run: | - query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;;" edxapp;) + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + echo "echo $query_result1" numeric_result=$(echo "query_result1" | sed 's/[^0-9]*//g') echo "Numeric Result: $numeric_result" echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV From a81c86f159024773937276f807fff6cb945812d4 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 22:54:32 +0500 Subject: [PATCH 073/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index f23eb3756174..a8dff4fd73e7 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -142,7 +142,7 @@ jobs: run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) echo "echo $query_result1" - numeric_result=$(echo "query_result1" | sed 's/[^0-9]*//g') + numeric_result=$(echo "$query_result1" | tr -d '\n' | sed -E 's/[^0-9]+//g') echo "Numeric Result: $numeric_result" echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV From 5475cb3ee2453b3f8fb9d0fb24fe4cdc0201c710 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:03:35 +0500 Subject: [PATCH 074/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 36 ++++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index a8dff4fd73e7..28458139b23d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -154,26 +154,26 @@ jobs: - name: Checkout branch repo uses: actions/checkout@v2 -# - 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: | -# pip freeze + - name: list installed package versions + run: | + 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 + - 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 social_django # echo "Running the CMS migrations." # ./manage.py cms migrate From 8b9ecb3eb14b598771a3afeb6000871633f61fe2 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:10:18 +0500 Subject: [PATCH 075/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 28458139b23d..5b3095a8c9b8 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -184,13 +184,13 @@ jobs: captured_result="${{ env.query_r }}" echo "Captured Output: $captured_result" query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) - numeric_result=$(echo "$query_result" | tr -d '[:space:]') + numeric_result=$(echo "$query_result1" | tr -d '\n' | sed -E 's/[^0-9]+//g') echo "Numeric Result: $numeric_result" - echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV + echo "SECOND_QUERY=$numeric_result" >> $GITHUB_ENV - name: Verify difference run: | - echo "echo ${{env.FIRST_QUERY}}" + echo "echo ${{env.SECOND_QUERY}}" # echo "echo ${{env.query_result1}}" # number1=${{ env.query_result1 }} # number2=${{ env.query_result1 }} From 6f03b5b91cc4381634acbc1a9be3c886ee0d6b5f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:13:03 +0500 Subject: [PATCH 076/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 5b3095a8c9b8..76fb6c3ab3d4 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -191,11 +191,11 @@ jobs: - name: Verify difference run: | echo "echo ${{env.SECOND_QUERY}}" -# echo "echo ${{env.query_result1}}" -# number1=${{ env.query_result1 }} -# number2=${{ env.query_result1 }} + echo "echo ${{env.FIRST_QUERY}}" + number1=${{ env.SECOND_QUERY }} + number2=${{ env.FIRST_QUERY }} # # Perform subtraction -# diff=$((number1 - number2)) + diff=$((number1 - number2)) # result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) # echo "Query Result: $result" # echo "$result" From 01a76c53f0182c8db1aa6c6b07ce8cb71e00fe37 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:16:31 +0500 Subject: [PATCH 077/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 76fb6c3ab3d4..0249c4603fbe 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -181,8 +181,6 @@ jobs: shell: bash id: capture2 run: | - captured_result="${{ env.query_r }}" - echo "Captured Output: $captured_result" query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) numeric_result=$(echo "$query_result1" | tr -d '\n' | sed -E 's/[^0-9]+//g') echo "Numeric Result: $numeric_result" From ef11b7039b4f56313efcfb7abfcad9b3a428b9f9 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:17:06 +0500 Subject: [PATCH 078/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 0249c4603fbe..b684e82006e4 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -188,8 +188,8 @@ jobs: - name: Verify difference run: | - echo "echo ${{env.SECOND_QUERY}}" - echo "echo ${{env.FIRST_QUERY}}" + echo "echo ${{ env.SECOND_QUERY }}" + echo "echo ${{ env.FIRST_QUERY }}" number1=${{ env.SECOND_QUERY }} number2=${{ env.FIRST_QUERY }} # # Perform subtraction From 627082ae4cd01efd7171e5690740bc92206e0791 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:19:14 +0500 Subject: [PATCH 079/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index b684e82006e4..fdb1ad9e9f45 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -181,7 +181,8 @@ jobs: shell: bash id: capture2 run: | - query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + echo "echo $query_result1" numeric_result=$(echo "$query_result1" | tr -d '\n' | sed -E 's/[^0-9]+//g') echo "Numeric Result: $numeric_result" echo "SECOND_QUERY=$numeric_result" >> $GITHUB_ENV @@ -192,7 +193,6 @@ jobs: echo "echo ${{ env.FIRST_QUERY }}" number1=${{ env.SECOND_QUERY }} number2=${{ env.FIRST_QUERY }} -# # Perform subtraction diff=$((number1 - number2)) # result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) # echo "Query Result: $result" From b8c6cf17321b4bae3a257517f1aecff683c7c8cd Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:27:42 +0500 Subject: [PATCH 080/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index fdb1ad9e9f45..d13b38053388 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -194,8 +194,8 @@ jobs: number1=${{ env.SECOND_QUERY }} number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) -# result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) -# echo "Query Result: $result" + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff;" edxapp;) + echo "Query Result: $result" # echo "$result" shell: bash From afdb3b6b91744aea8fed797123280661f70f8f6a Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:48:45 +0500 Subject: [PATCH 081/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index d13b38053388..edc717541fba 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -194,11 +194,18 @@ jobs: number1=${{ env.SECOND_QUERY }} number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select * from django_migrations ORDER by -id limit $diff;" edxapp;) + result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "Query Result: $result" + echo "new_migrations=$numeric_result" >> $GITHUB_ENV # echo "$result" shell: bash + - name: Comment PR + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + Few migraions added on your PR ${{ env.new_migrations }}. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why From 5767c234afa4a4d4461d6122eaecc5ab6ab896af Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 23:56:50 +0500 Subject: [PATCH 082/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index edc717541fba..85a0f9193a04 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -196,7 +196,7 @@ jobs: diff=$((number1 - number2)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "Query Result: $result" - echo "new_migrations=$numeric_result" >> $GITHUB_ENV + echo "new_migrations=$result" >> $GITHUB_ENV # echo "$result" shell: bash From b064db73d72be7f208e87554159f0a8ea8bf5793 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 00:12:43 +0500 Subject: [PATCH 083/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 85a0f9193a04..ebe222062da1 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -204,8 +204,9 @@ jobs: uses: thollander/actions-comment-pull-request@v2 with: message: | - Few migraions added on your PR ${{ env.new_migrations }}. + Few migraions added on your PR ${{ env.new_migrations }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why From 285b2cc540ef45c8388288b4b3ca39920a4fc1d0 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 00:18:16 +0500 Subject: [PATCH 084/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index ebe222062da1..3e749428ff54 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -203,8 +203,7 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: | - Few migraions added on your PR ${{ env.new_migrations }} + message: Few migraions added on your PR ${{ env.new_migrations }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash From ddf6ee6f9ced87ccd3394bbec384efe5f776e543 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 00:20:32 +0500 Subject: [PATCH 085/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 3e749428ff54..8b2c99451643 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -203,7 +203,7 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: Few migraions added on your PR ${{ env.new_migrations }} + message: Few migraions added on your GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash From 72eefe507181a0b6e61abc0636e6d5e40bb6916d Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 00:22:00 +0500 Subject: [PATCH 086/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 8b2c99451643..d8761aff248d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -197,13 +197,13 @@ jobs: result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "Query Result: $result" echo "new_migrations=$result" >> $GITHUB_ENV -# echo "$result" shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: Few migraions added on your + message: | + Few migraions added on your GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash From a48e7c1f7b77c3d197026c69e4b7c54dba0083f4 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 00:25:00 +0500 Subject: [PATCH 087/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index d8761aff248d..45cdeb0c00d5 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -199,13 +199,13 @@ jobs: echo "new_migrations=$result" >> $GITHUB_ENV shell: bash - - name: Comment PR - uses: thollander/actions-comment-pull-request@v2 - with: - message: | - Few migraions added on your - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash +# - name: Comment PR +# uses: thollander/actions-comment-pull-request@v2 +# with: +# message: | +# Few migraions added on your +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# shell: bash # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why From 8d6b1c62304ba44f6ad316612e41999b19b60ea0 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 00:31:14 +0500 Subject: [PATCH 088/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 45cdeb0c00d5..a8b2cb9c067d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -199,13 +199,12 @@ jobs: echo "new_migrations=$result" >> $GITHUB_ENV shell: bash -# - name: Comment PR -# uses: thollander/actions-comment-pull-request@v2 -# with: -# message: | -# Few migraions added on your -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# shell: bash + - name: Comment PR + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + New migrations added "${{ env.SECOND_QUERY }}". + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why From c3e30ad2cb7d671994c988bd8bf2abf466c2ad58 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 00:40:39 +0500 Subject: [PATCH 089/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index a8b2cb9c067d..d00d003316e8 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -196,14 +196,13 @@ jobs: diff=$((number1 - number2)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "Query Result: $result" - echo "new_migrations=$result" >> $GITHUB_ENV + echo "CUSTOM_MESSAGE=$result" >> $GITHUB_ENV shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: | - New migrations added "${{ env.SECOND_QUERY }}". + message: ${{ env.CUSTOM_MESSAGE }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From f98b1839ceb2f221fb5f9ae083641960949b566c Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 00:48:52 +0500 Subject: [PATCH 090/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index d00d003316e8..030015334ff2 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -195,8 +195,9 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) - echo "Query Result: $result" - echo "CUSTOM_MESSAGE=$result" >> $GITHUB_ENV + formatted_data=$(echo "$data" | tr '\t' ' ') + echo "Query Result: formatted_data" + echo "CUSTOM_MESSAGE=formatted_data" >> $GITHUB_ENV shell: bash - name: Comment PR From 6a7052cfea51d923f42e3c63cdc9ea344328e21b Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 01:00:08 +0500 Subject: [PATCH 091/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 030015334ff2..c74114cf3204 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -196,8 +196,8 @@ jobs: diff=$((number1 - number2)) result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) formatted_data=$(echo "$data" | tr '\t' ' ') - echo "Query Result: formatted_data" - echo "CUSTOM_MESSAGE=formatted_data" >> $GITHUB_ENV + echo "Query Result: $formatted_data" + echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV shell: bash - name: Comment PR From 6e5f07a5de2e1c4cce56fe5ca97a7287e97fc1a8 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 01:09:51 +0500 Subject: [PATCH 092/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index c74114cf3204..b5eb1ffb227d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -187,7 +187,7 @@ jobs: echo "Numeric Result: $numeric_result" echo "SECOND_QUERY=$numeric_result" >> $GITHUB_ENV - - name: Verify difference + - name: Process Data run: | echo "echo ${{ env.SECOND_QUERY }}" echo "echo ${{ env.FIRST_QUERY }}" @@ -203,7 +203,7 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: ${{ env.CUSTOM_MESSAGE }} + message: ${{ steps.process-data.outputs.formatted_data }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 5c03ce848b4d6f648570e895652711c1065bf04f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 01:16:42 +0500 Subject: [PATCH 093/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index b5eb1ffb227d..cbd3650b7519 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -203,7 +203,8 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: ${{ steps.process-data.outputs.formatted_data }} + message: | + ${{ steps.process-data.outputs.formatted_data }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From b3940d4c5824562f17ab30f55e484a2c316d148b Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 01:56:26 +0500 Subject: [PATCH 094/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index cbd3650b7519..cf0f44305947 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -194,7 +194,7 @@ jobs: number1=${{ env.SECOND_QUERY }} number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) + data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) formatted_data=$(echo "$data" | tr '\t' ' ') echo "Query Result: $formatted_data" echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV From 0e3ec4b53fbd39ad88308a118f65a0b7ec6c3d35 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 02:08:30 +0500 Subject: [PATCH 095/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index cf0f44305947..33699017efaa 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -195,16 +195,18 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) - formatted_data=$(echo "$data" | tr '\t' ' ') - echo "Query Result: $formatted_data" - echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV +# formatted_data=$(echo "$data" | tr '\t' ' ') +# echo "Query Result: $formatted_data" + echo "$data" > multi_line_data.txt + echo "::set-env name=MULTI_LINE_DATA_PATH::multi_line_data.txt" +# echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: message: | - ${{ steps.process-data.outputs.formatted_data }} + ${{ env.MULTI_LINE_DATA_PATH}} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From a5ef96d1d7ff7ab092bfd3ef732f0f158a9c8403 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 02:12:32 +0500 Subject: [PATCH 096/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 33699017efaa..f002580f0967 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -195,18 +195,18 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) -# formatted_data=$(echo "$data" | tr '\t' ' ') -# echo "Query Result: $formatted_data" + formatted_data=$(echo "$data" | tr '\t' ' ') + echo "Query Result: $formatted_data" + echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV echo "$data" > multi_line_data.txt echo "::set-env name=MULTI_LINE_DATA_PATH::multi_line_data.txt" -# echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: message: | - ${{ env.MULTI_LINE_DATA_PATH}} + ${{ steps.process-data.outputs.formatted_data }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From fc0975f10712530b8e0db8ad8bcab36403558d70 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 02:21:26 +0500 Subject: [PATCH 097/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index f002580f0967..affd51245132 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -195,18 +195,14 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) - formatted_data=$(echo "$data" | tr '\t' ' ') - echo "Query Result: $formatted_data" - echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV - echo "$data" > multi_line_data.txt - echo "::set-env name=MULTI_LINE_DATA_PATH::multi_line_data.txt" + echo "CUSTOM_MESSAGE=$data" >> $GITHUB_ENV shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: message: | - ${{ steps.process-data.outputs.formatted_data }} + ${{ env.CUSTOM_MESSAGE }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 741b0c07bb6cda206513cee64d39f482fcc81429 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 02:28:24 +0500 Subject: [PATCH 098/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index affd51245132..3445d34fab8d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -195,14 +195,19 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) - echo "CUSTOM_MESSAGE=$data" >> $GITHUB_ENV + formatted_data=$(echo "$data" | tr '\t' ' ') + echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV + echo "$formatted_data" > multi_line_data.txt shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: message: | - ${{ env.CUSTOM_MESSAGE }} + Here is the data: + ``` + $(cat multi_line_data.txt) + ``` GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From b5fd62a5c62db2c646cb6a2fc534da3d6f5598b5 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 02:34:32 +0500 Subject: [PATCH 099/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 3445d34fab8d..d89636003508 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -197,17 +197,11 @@ jobs: data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) formatted_data=$(echo "$data" | tr '\t' ' ') echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV - echo "$formatted_data" > multi_line_data.txt shell: bash - - - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: message: | - Here is the data: - ``` - $(cat multi_line_data.txt) - ``` + ${{ formatted_data }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 2de3bd327edd0f39e429d48a801d0490b00d8fef Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 02:36:52 +0500 Subject: [PATCH 100/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index d89636003508..ad014653ca03 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -196,12 +196,10 @@ jobs: diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) formatted_data=$(echo "$data" | tr '\t' ' ') - echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV shell: bash uses: thollander/actions-comment-pull-request@v2 with: - message: | - ${{ formatted_data }} + message: ${{ formatted_data }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 1787a61be6ac3852aa6544f81b1cf50031c6e03b Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 02:38:49 +0500 Subject: [PATCH 101/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index ad014653ca03..a40dfc1cd9e4 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -196,10 +196,15 @@ jobs: diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) formatted_data=$(echo "$data" | tr '\t' ' ') + echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV shell: bash + + - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: ${{ formatted_data }} + message: | + Here is the data: + ${{ secrets.CUSTOM_MESSAGE }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From f0913e104ed82177aad631155c206cd46230f190 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 02:44:56 +0500 Subject: [PATCH 102/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index a40dfc1cd9e4..3171d4c3dc50 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -196,6 +196,7 @@ jobs: diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) formatted_data=$(echo "$data" | tr '\t' ' ') + echo "echo ${{ formatted_data }}" echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV shell: bash From 4694586e40c9f2a287ded03492cd5f8f5bf95e8f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 12:26:39 +0500 Subject: [PATCH 103/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 3171d4c3dc50..51cf3f79321e 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -194,18 +194,18 @@ jobs: number1=${{ env.SECOND_QUERY }} number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) - data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) + data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) formatted_data=$(echo "$data" | tr '\t' ' ') echo "echo ${{ formatted_data }}" - echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV +# echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV + echo "$formatted_data" > multi_line_data.txt shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: | - Here is the data: - ${{ secrets.CUSTOM_MESSAGE }} + with: + filePath: /path/to/file.txt GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From a97f8d44b04c91de7158c03d30b0e745d329e1f9 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 12:28:24 +0500 Subject: [PATCH 104/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 51cf3f79321e..46304f27b3c0 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -203,9 +203,7 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 - with: - with: - filePath: /path/to/file.txt + filePath: multi_line_data.txt GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 15af0d17009689724c2bf4894cf3bdaf5a578369 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 12:30:40 +0500 Subject: [PATCH 105/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 46304f27b3c0..82d282d00bcc 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -189,14 +189,11 @@ jobs: - name: Process Data run: | - echo "echo ${{ env.SECOND_QUERY }}" - echo "echo ${{ env.FIRST_QUERY }}" number1=${{ env.SECOND_QUERY }} number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) formatted_data=$(echo "$data" | tr '\t' ' ') - echo "echo ${{ formatted_data }}" # echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV echo "$formatted_data" > multi_line_data.txt shell: bash From 7f2e60dd2a2c9aeda39852a819933670d12d4b0a Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 12:32:44 +0500 Subject: [PATCH 106/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 82d282d00bcc..7ba719bd8616 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -187,21 +187,21 @@ jobs: echo "Numeric Result: $numeric_result" echo "SECOND_QUERY=$numeric_result" >> $GITHUB_ENV - - name: Process Data - run: | - number1=${{ env.SECOND_QUERY }} - number2=${{ env.FIRST_QUERY }} - diff=$((number1 - number2)) - data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) - formatted_data=$(echo "$data" | tr '\t' ' ') -# echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV - echo "$formatted_data" > multi_line_data.txt - shell: bash - - - name: Comment PR - uses: thollander/actions-comment-pull-request@v2 - filePath: multi_line_data.txt - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# - name: Process Data +# run: | +# number1=${{ env.SECOND_QUERY }} +# number2=${{ env.FIRST_QUERY }} +# diff=$((number1 - number2)) +# data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) +# formatted_data=$(echo "$data" | tr '\t' ' ') +## echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV +# echo "$formatted_data" > multi_line_data.txt +# shell: bash +# +# - name: Comment PR +# uses: thollander/actions-comment-pull-request@v2 +# filePath: multi_line_data.txt +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why From 584aa4ea20dd6ac42b413924595d2c8da8a4914e Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 12:33:14 +0500 Subject: [PATCH 107/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 7ba719bd8616..359a57ad211c 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -187,16 +187,16 @@ jobs: echo "Numeric Result: $numeric_result" echo "SECOND_QUERY=$numeric_result" >> $GITHUB_ENV -# - name: Process Data -# run: | -# number1=${{ env.SECOND_QUERY }} -# number2=${{ env.FIRST_QUERY }} -# diff=$((number1 - number2)) -# data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) -# formatted_data=$(echo "$data" | tr '\t' ' ') -## echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV + - name: Process Data + run: | + number1=${{ env.SECOND_QUERY }} + number2=${{ env.FIRST_QUERY }} + diff=$((number1 - number2)) + data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) + formatted_data=$(echo "$data" | tr '\t' ' ') + echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV # echo "$formatted_data" > multi_line_data.txt -# shell: bash + shell: bash # # - name: Comment PR # uses: thollander/actions-comment-pull-request@v2 From df32bc1296ae1b2821e4431f913ca07bb78f571e Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:01:24 +0500 Subject: [PATCH 108/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 29 +++++--------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 359a57ad211c..9b2808e192cf 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -108,7 +108,7 @@ jobs: pip check # fail if this test-reqs/Django combination is broken fi - - name: Run Tests + - name: Run migrations on master branch 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. @@ -119,23 +119,6 @@ jobs: # echo "Running the CMS migrations." # ./manage.py cms migrate -# - name: "Setup env vars" -# id: envvars -# run: | -# number1=10 -# number2=5 -# echo "Number 1: $number1" -# echo "Number 2: $number2" -# result=$((number1 - number2)) -# echo "Result: $result" -# echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV -# shell: bash -# -# - name: Use subtraction result -# run: | -# subtraction_result=${{ env.SUBTRACTION_RESULT }} -# echo "Subtraction Result: $subtraction_result" - - name: Verify executed migrations on master. id: capture1 shell: bash @@ -193,13 +176,15 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) - formatted_data=$(echo "$data" | tr '\t' ' ') - echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV +# formatted_data=$(echo "$data" | tr '\t' ' ') + echo "$data" > multi_line_data.txt + echo "echo $data" +# echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV # echo "$formatted_data" > multi_line_data.txt shell: bash # -# - name: Comment PR -# uses: thollander/actions-comment-pull-request@v2 + - name: Comment PR + uses: thollander/actions-comment-pull-request@v2 # filePath: multi_line_data.txt # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e916d96cc1931b50878e1600776e97c1d8fa158f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:03:26 +0500 Subject: [PATCH 109/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 9b2808e192cf..a61c91518fcf 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -177,7 +177,7 @@ jobs: diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) # formatted_data=$(echo "$data" | tr '\t' ' ') - echo "$data" > multi_line_data.txt +# echo "$data" > multi_line_data.txt echo "echo $data" # echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV # echo "$formatted_data" > multi_line_data.txt From 8bb6649e80c9b243a340d990a1e0a3353c252d62 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:05:42 +0500 Subject: [PATCH 110/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index a61c91518fcf..61d9aa1a265d 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -178,7 +178,7 @@ jobs: data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) # formatted_data=$(echo "$data" | tr '\t' ' ') # echo "$data" > multi_line_data.txt - echo "echo $data" +# echo "echo $data" # echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV # echo "$formatted_data" > multi_line_data.txt shell: bash From 4e45a2aad1d401df4aa7ece05104c14c14a61d43 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:07:54 +0500 Subject: [PATCH 111/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 61d9aa1a265d..196396be388f 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -179,14 +179,17 @@ jobs: # formatted_data=$(echo "$data" | tr '\t' ' ') # echo "$data" > multi_line_data.txt # echo "echo $data" -# echo "CUSTOM_MESSAGE=$formatted_data" >> $GITHUB_ENV + echo "CUSTOM_MESSAGE=$data" >> $GITHUB_ENV # echo "$formatted_data" > multi_line_data.txt shell: bash # - name: Comment PR uses: thollander/actions-comment-pull-request@v2 + with: + message: | + ${{ env.CUSTOM_MESSAGE }} # filePath: multi_line_data.txt -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why From 884ea606f8c6fe08f8341a040195345672102eb6 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:10:51 +0500 Subject: [PATCH 112/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 196396be388f..02d6998ec7a3 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -186,8 +186,7 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: | - ${{ env.CUSTOM_MESSAGE }} + message: ${{ env.CUSTOM_MESSAGE }} # filePath: multi_line_data.txt GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 30eaff8e4d08bc043aba1df5a3016d1882f285eb Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:12:15 +0500 Subject: [PATCH 113/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 02d6998ec7a3..9052ca776ff9 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -176,18 +176,12 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) -# formatted_data=$(echo "$data" | tr '\t' ' ') -# echo "$data" > multi_line_data.txt -# echo "echo $data" echo "CUSTOM_MESSAGE=$data" >> $GITHUB_ENV -# echo "$formatted_data" > multi_line_data.txt shell: bash -# - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: message: ${{ env.CUSTOM_MESSAGE }} -# filePath: multi_line_data.txt GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 0668178cf7eb5b10ff54fc30554d8de0b961377b Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:20:30 +0500 Subject: [PATCH 114/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 9052ca776ff9..5057b958a5c4 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -178,10 +178,11 @@ jobs: data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "CUSTOM_MESSAGE=$data" >> $GITHUB_ENV shell: bash + - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: ${{ env.CUSTOM_MESSAGE }} + message: "Testing" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From c09efbb5d3f1534f19f3c3c8493231b39ffa1b4f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:26:34 +0500 Subject: [PATCH 115/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 5057b958a5c4..3f09aac2a7bf 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -176,7 +176,7 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) - echo "CUSTOM_MESSAGE=$data" >> $GITHUB_ENV +# echo "CUSTOM_MESSAGE=$data" >> $GITHUB_ENV shell: bash - name: Comment PR From fdcf6aef41e46c753de0f6f6d0e90f1a51c3636f Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:33:50 +0500 Subject: [PATCH 116/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 3f09aac2a7bf..416f023c4f11 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -176,7 +176,7 @@ jobs: number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) -# echo "CUSTOM_MESSAGE=$data" >> $GITHUB_ENV + echo "$data" > cleaned_data.txt shell: bash - name: Comment PR From 2490833a8cda275073fccca846c1a7fbc1911043 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:43:37 +0500 Subject: [PATCH 117/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 416f023c4f11..b56325f77d78 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -182,7 +182,7 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: "Testing" + message: $(cat cleaned_data.txt) GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 85ad6e389ca400773f6f760f19fd43df6e945f89 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 13:51:57 +0500 Subject: [PATCH 118/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index b56325f77d78..91a4b40de773 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -182,7 +182,11 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: $(cat cleaned_data.txt) + message: | + Here is the data: + ``` + $(cat cleaned_data.txt) + ``` GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 0b1a933a41d504a8a7a59defd370a0a4fa0cb333 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 14:03:35 +0500 Subject: [PATCH 119/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 91a4b40de773..4ed9a45025ab 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -178,15 +178,9 @@ jobs: data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "$data" > cleaned_data.txt shell: bash - - - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: | - Here is the data: - ``` - $(cat cleaned_data.txt) - ``` + message: $data GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 8582e2e7893c6675af0852a0f7e3a68be80ecc1d Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 14:05:14 +0500 Subject: [PATCH 120/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 4ed9a45025ab..91a4b40de773 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -178,9 +178,15 @@ jobs: data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "$data" > cleaned_data.txt shell: bash + + - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: $data + message: | + Here is the data: + ``` + $(cat cleaned_data.txt) + ``` GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From 9a5b696f111613bb2825f271d2f4fabad02883ac Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 14:23:00 +0500 Subject: [PATCH 121/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 91a4b40de773..25b0c93ea3dc 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -175,18 +175,14 @@ jobs: number1=${{ env.SECOND_QUERY }} number2=${{ env.FIRST_QUERY }} diff=$((number1 - number2)) - data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select app, name from django_migrations ORDER by -id limit $diff;" edxapp;) + data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "$data" > cleaned_data.txt shell: bash - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: | - Here is the data: - ``` - $(cat cleaned_data.txt) - ``` + filePath: cleaned_data.txt GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This job aggregates test results. It's the required check for branch protection. From a42792a485edcef906650facd609c77e63c074e1 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 14:44:44 +0500 Subject: [PATCH 122/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 25b0c93ea3dc..39f6bcd4c097 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -172,14 +172,21 @@ jobs: - name: Process Data run: | - number1=${{ env.SECOND_QUERY }} - number2=${{ env.FIRST_QUERY }} - diff=$((number1 - number2)) - data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) - echo "$data" > cleaned_data.txt + number2=${{ env.SECOND_QUERY }} + number1=${{ env.FIRST_QUERY }} + + if [ $number2 -gt $number1 ]; then + diff=$((number2 - number1)) + data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) + echo "$data" > cleaned_data.txt + elif [ $number1 -gt $number2 ]; then + echo "Your PR removed some migrations" > cleaned_data.txt + fi shell: bash - name: Comment PR + number2=${{ env.SECOND_QUERY }} + number1=${{ env.FIRST_QUERY }} uses: thollander/actions-comment-pull-request@v2 with: filePath: cleaned_data.txt From 764e010ee4283db9ed5d0092f0f5b6c86bbd4bc9 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 14:48:58 +0500 Subject: [PATCH 123/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 39f6bcd4c097..25b0c93ea3dc 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -172,21 +172,14 @@ jobs: - name: Process Data run: | - number2=${{ env.SECOND_QUERY }} - number1=${{ env.FIRST_QUERY }} - - if [ $number2 -gt $number1 ]; then - diff=$((number2 - number1)) - data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) - echo "$data" > cleaned_data.txt - elif [ $number1 -gt $number2 ]; then - echo "Your PR removed some migrations" > cleaned_data.txt - fi + number1=${{ env.SECOND_QUERY }} + number2=${{ env.FIRST_QUERY }} + diff=$((number1 - number2)) + data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) + echo "$data" > cleaned_data.txt shell: bash - name: Comment PR - number2=${{ env.SECOND_QUERY }} - number1=${{ env.FIRST_QUERY }} uses: thollander/actions-comment-pull-request@v2 with: filePath: cleaned_data.txt From 83bc48efc43146f6e8e39e9d6b928f1495ac8b23 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 14:51:13 +0500 Subject: [PATCH 124/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 25b0c93ea3dc..9496e99b99a2 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -172,11 +172,13 @@ jobs: - name: Process Data run: | - number1=${{ env.SECOND_QUERY }} - number2=${{ env.FIRST_QUERY }} - diff=$((number1 - number2)) - data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) - echo "$data" > cleaned_data.txt + number2=${{ env.SECOND_QUERY }} + number1=${{ env.FIRST_QUERY }} + diff=$((number2 - number1)) + if [ $number2 -gt $number1 ]; then + data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) + echo "$data" > cleaned_data.txt + fi shell: bash - name: Comment PR From 6172e08089f836f083ffc229b5a2f77f1b8bda2a Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 15:04:29 +0500 Subject: [PATCH 125/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 9496e99b99a2..8ea69efdcc75 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -178,6 +178,8 @@ jobs: if [ $number2 -gt $number1 ]; then data=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select name from django_migrations ORDER by -id limit $diff;" edxapp;) echo "$data" > cleaned_data.txt + elif [ $number1 -gt $number2 ]; then + echo "Your PR removed migrations." > cleaned_data.txt fi shell: bash From 5df08af0e9358028b9b5f4b51572de1c0fa5c521 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 15:13:19 +0500 Subject: [PATCH 126/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 4 +++- openedx/core/djangoapps/credit/models.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 8ea69efdcc75..23de46be09a7 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -156,8 +156,10 @@ jobs: STUDIO_CFG: lms/envs/minimal.yml run: | echo "Running the LMS migrations." + ./manage.py lms makemigrations ./manage.py lms migrate social_django -# echo "Running the CMS migrations." + echo "Running the CMS migrations." + ./manage.py cms makemigrations # ./manage.py cms migrate - name: Verify executed migrations on branch. diff --git a/openedx/core/djangoapps/credit/models.py b/openedx/core/djangoapps/credit/models.py index 2a9fa2088551..f29f5a5a02a5 100644 --- a/openedx/core/djangoapps/credit/models.py +++ b/openedx/core/djangoapps/credit/models.py @@ -141,6 +141,11 @@ class CreditProvider(TimeStampedModel): ) ) + display_name_testing = models.CharField( + max_length=255, + help_text=gettext_lazy("Name of the credit provider displayed to users") + ) + CREDIT_PROVIDERS_CACHE_KEY = "credit.providers.list" @classmethod From b4708684e10b73cde7f398ba04a161141625430d Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 1 Nov 2023 15:21:12 +0500 Subject: [PATCH 127/127] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 1 + openedx/core/djangoapps/credit/models.py | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index 23de46be09a7..8f94f4f96289 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -158,6 +158,7 @@ jobs: echo "Running the LMS migrations." ./manage.py lms makemigrations ./manage.py lms migrate social_django + echo "Running the CMS migrations." ./manage.py cms makemigrations # ./manage.py cms migrate diff --git a/openedx/core/djangoapps/credit/models.py b/openedx/core/djangoapps/credit/models.py index f29f5a5a02a5..79473bdb3a22 100644 --- a/openedx/core/djangoapps/credit/models.py +++ b/openedx/core/djangoapps/credit/models.py @@ -142,6 +142,7 @@ class CreditProvider(TimeStampedModel): ) display_name_testing = models.CharField( + null=True, max_length=255, help_text=gettext_lazy("Name of the credit provider displayed to users") )