From dfcf006c60ac39ac04e8d57515f34742f752cbea Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Fri, 13 Nov 2026 15:16:24 -0500 Subject: [PATCH] build: run the migrations check against a MySQL service container ubuntu-latest moved to ubuntu-26.04 and that image has no /etc/init.d/mysql, so the "Initiate Services" step has failed on every PR since 2026-11-10: sudo: '/etc/init.d/mysql': command not found Stop depending on the runner's preinstalled server. Run MySQL 8 as a service container with openedx-platform's default database name and credentials, the same setup as openedx/edx-submissions#394 and openedx/edx-enterprise-data#730. The client headers mysqlclient needs are installed with --no-upgrade so apt does not try to upgrade the image's mysql-server, whose post-install script fails on 26.04. Tracked in https://github.com/openedx/public-engineering/issues/577 Co-Authored-By: Claude Fable 5.1 --- .github/workflows/migrations-mysql8-check.yml | 53 +++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/.github/workflows/migrations-mysql8-check.yml b/.github/workflows/migrations-mysql8-check.yml index c18ff27e1..0c81d3f57 100644 --- a/.github/workflows/migrations-mysql8-check.yml +++ b/.github/workflows/migrations-mysql8-check.yml @@ -14,6 +14,25 @@ jobs: strategy: matrix: python-version: ["3.12"] + mysql-version: ["8"] + services: + mysql: + image: mysql:${{ matrix.mysql-version }} + ports: + - 3306:3306 + env: + MYSQL_DATABASE: "edxapp" + MYSQL_USER: "edxapp001" + MYSQL_PASSWORD: "password" + MYSQL_RANDOM_ROOT_PASSWORD: true + # Ping over TCP, not the socket. On first start the image creates the + # database and user using a temporary server with networking turned off, + # so a socket ping can report healthy before MySQL accepts connections. + options: >- + --health-cmd "mysqladmin ping -h 127.0.0.1" + --health-interval 5s + --health-timeout 5s + --health-retries 20 steps: - name: Checkout repo @@ -24,10 +43,14 @@ jobs: with: python-version: ${{ matrix.python-version }} + # mysqlclient is built from source below and needs the client headers. + # --no-upgrade leaves the image's own MySQL packages alone: upgrading the + # client pulls in a mysql-server upgrade whose post-install script fails + # on ubuntu-26.04 runners. - name: Install system Packages run: | sudo apt-get update - sudo apt-get install -y libxmlsec1-dev + sudo apt-get install -y --no-upgrade libxmlsec1-dev libmysqlclient-dev mysql-client pkg-config - name: Get pip cache dir id: pip-cache-dir run: | @@ -40,10 +63,6 @@ jobs: key: ${{ runner.os }}-pip-${{ hashFiles('requirements/pip_tools.txt') }} restore-keys: ${{ runner.os }}-pip- - - name: Ubuntu and sql Versions - run: | - lsb_release -a - mysql -V - name: Install Python dependencies run: | pip install -r requirements/pip_tools.txt @@ -53,25 +72,17 @@ jobs: pip uninstall -y xmlsec pip install --no-binary xmlsec xmlsec xmlsec==1.3.13 - - name: Initiate Services - run: | - sudo /etc/init.d/mysql start - - name: Reset mysql password + - name: Verify mysql db credentials run: | - cat <