From 0a332a303dac1c612f83ba4e06bcb1c5c36df948 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 21 Jun 2024 19:41:57 +1000 Subject: [PATCH 1/4] mariadb: add nightly workflow to facilitate mariadb "nightlies" (#6435) | Q | A |------------- | ----------- | Type | improvement | Fixed issues | #6433 #### Summary Nightly cron scheduled alternate to #6433. --- .github/workflows/nightly.yml | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000000..99799afcb7d --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,72 @@ +name: "Continuous Integration (Nightly)" + +on: + schedule: + - cron: "12 3 * * *" + +env: + fail-fast: true + +jobs: + phpunit-mariadb: + name: "PHPUnit with MariaDB" + runs-on: "ubuntu-24.04" + + strategy: + matrix: + php-version: + - "7.4" + - "8.3" + mariadb-version: + - "earliest" + - "verylatest" + extension: + - "mysqli" + - "pdo_mysql" + + services: + mariadb: + image: "quay.io/mariadb-foundation/mariadb-devel:${{ matrix.mariadb-version }}" + env: + MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes + MARIADB_DATABASE: "doctrine_tests" + + options: >- + --health-cmd "healthcheck.sh --connect --innodb_initialized" + + ports: + - "3306:3306" + + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + with: + fetch-depth: 2 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + coverage: "pcov" + ini-values: "zend.assertions=1" + extensions: "${{ matrix.extension }}" + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v3" + with: + composer-options: "--ignore-platform-req=php+" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml" + + - name: Tell the MariaDB Folks if it failed + if: ${{ failure() }} + uses: zulip/github-actions-zulip/send-message@v1 + with: + api-key: ${{ secrets.MARIADB_ZULIP_API_KEY }} + email: "doctrine-bot@mariadb.zulipchat.com" + organization-url: "https://mariadb.zulipchat.com" + to: "Buildbot" + type: "stream" + topic: "CI - Doctrine/DBAL" + content: "There was an error running Doctrine on MariaDB:${{ matrix.mariadb-version }} - URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}." From d3959ed0995d37dc28bf1587d48f259376c4df3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 2 Jul 2024 21:13:30 +0200 Subject: [PATCH 2/4] Complete sentence I asked internally how it is supposed to end, and got the answer straight from the horse's mouth. --- src/Schema/AbstractAsset.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Schema/AbstractAsset.php b/src/Schema/AbstractAsset.php index ab8fdec0303..6934133ffb9 100644 --- a/src/Schema/AbstractAsset.php +++ b/src/Schema/AbstractAsset.php @@ -20,7 +20,8 @@ * The abstract asset allows to reset the name of all assets without publishing this to the public userland. * * This encapsulation hack is necessary to keep a consistent state of the database schema. Say we have a list of tables - * array($tableName => Table($tableName)); if you want to rename the table, you have to make sure + * array($tableName => Table($tableName)); if you want to rename the table, you have to make sure this does not get + * recreated during schema migration. */ abstract class AbstractAsset { From b35648d64d9b641ee20f74b29f01a894e38027b6 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 16 Jul 2024 12:45:52 +0200 Subject: [PATCH 3/4] CI: Add MySQL 9, reduce test matrix (#6462) MySQL 9 has been released and 8.4 has been declared to be the LTS release. I've added MySQL 9 to the test matrix and took the opportunity to shrink the test matrix a little. Our CI is othen blocked because of too many concurrent jobs, so we might not want to test all possible permutations of PHP and MySQL versions. Taking into account that we're going to maintain the 3.x branch for a little longer, we need a strategy for not letting the test matrix grow exponentially with every future PHP or DBMS release. My proposal for MySQL: * Test all supported MySQL versions (currently: 5.7, 8.0, 8.4, 9.0) with the latest PHP version (currently 8.3). * Test the oldest supported PHP release (currently 7.4) against one release only (MySQL 8.0) only. All other PHP releases are tested against SQLite already. If this proposal is accepted, I'd like to work out a similar strategy for the other supported DBMS. I think we should also document that strategy properly then. --- .github/workflows/continuous-integration.yml | 35 ++++--------------- .../Driver/VersionAwarePlatformDriverTest.php | 2 ++ 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fcb77758984..ac1a1101fc7 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -378,57 +378,34 @@ jobs: strategy: matrix: php-version: - - "7.4" - - "8.1" + - "8.3" mysql-version: - "5.7" - "8.0" + - "9.0" extension: - "mysqli" - "pdo_mysql" config-file-suffix: - "" include: - - mysql-version: "8.0" - # https://stackoverflow.com/questions/60902904/how-to-pass-mysql-native-password-to-mysql-service-in-github-actions - custom-entrypoint: >- - --entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" - config-file-suffix: "-tls" php-version: "7.4" mysql-version: "8.0" extension: "mysqli" - - php-version: "8.2" + - php-version: "7.4" mysql-version: "8.0" extension: "mysqli" - custom-entrypoint: >- - --entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" - - php-version: "8.2" + - php-version: "7.4" mysql-version: "8.0" extension: "pdo_mysql" - custom-entrypoint: >- - --entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" - - php-version: "8.3" - mysql-version: "8.0" - extension: "mysqli" + # Workaround for https://bugs.mysql.com/114876 - php-version: "8.3" - mysql-version: "8.0" - extension: "pdo_mysql" - - php-version: "7.4" mysql-version: "8.4" extension: "mysqli" custom-entrypoint: >- --entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON" - - php-version: "7.4" - mysql-version: "8.4" - extension: "pdo_mysql" - custom-entrypoint: >- - --entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON" - - php-version: "8.1" - mysql-version: "8.4" - extension: "mysqli" - custom-entrypoint: >- - --entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON" - - php-version: "8.1" + - php-version: "8.3" mysql-version: "8.4" extension: "pdo_mysql" custom-entrypoint: >- diff --git a/tests/Driver/VersionAwarePlatformDriverTest.php b/tests/Driver/VersionAwarePlatformDriverTest.php index 8a84607f954..e329f76a37d 100644 --- a/tests/Driver/VersionAwarePlatformDriverTest.php +++ b/tests/Driver/VersionAwarePlatformDriverTest.php @@ -51,6 +51,8 @@ public static function mySQLVersionProvider(): array ['8', MySQL80Platform::class], ['8.0', MySQL80Platform::class], ['8.0.11', MySQL80Platform::class], + ['8.4.1', MySQL80Platform::class], + ['9.0.0', MySQL80Platform::class], ['6', MySQL57Platform::class], ['10.0.15-MariaDB-1~wheezy', MySQLPlatform::class], ['5.5.5-10.1.25-MariaDB', MySQLPlatform::class], From 349c83393c96260d6afcec6be7c30a0eacde0196 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Mon, 22 Jul 2024 12:16:06 +0200 Subject: [PATCH 4/4] Properly handle MySQL error code 4031 from PHP 8.4 (#6363) | Q | A |------------- | ----------- | Type | improvement | Fixed issues | Prevents future issues ;-) #### Summary PHP 8.4 will support a new error code 4031 in mysqlnd when the connection is dropped due to timeouts. It has been introduced in: https://github.com/mysql/mysql-server/commit/14508bbb1790697c28659dd051fbc855cd3b5da9 And PHP 8.4 will support it: https://github.com/php/php-src/pull/13618 The PR gets the test suite green again (mysqli + pdo_mysql). I have used 4.0.x as base, but feel free to change according to your preferences. --- src/Driver/API/MySQL/ExceptionConverter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Driver/API/MySQL/ExceptionConverter.php b/src/Driver/API/MySQL/ExceptionConverter.php index 87d50aff9e3..fdfc75a77fd 100644 --- a/src/Driver/API/MySQL/ExceptionConverter.php +++ b/src/Driver/API/MySQL/ExceptionConverter.php @@ -101,6 +101,7 @@ public function convert(Exception $exception, ?Query $query): DriverException return new ConnectionException($exception, $query); case 2006: + case 4031: return new ConnectionLost($exception, $query); case 1048: