Skip to content

Commit 40814eb

Browse files
turegjorupclaude
andcommitted
feat: support MariaDB 10 and 11; default local to 11 LTS, matrix CI
- docker-compose.yml: pin local default to upstream `mariadb:11.4` (LTS until 2029-05); override via `MARIADB_IMAGE`. Drops the unused `ENCRYPT=1` toggle that only existed on the itkdev/mariadb wrapper. - .env / .env.test: parametrize Doctrine `serverVersion` via `MARIADB_VERSION` (default `11.4.4-MariaDB`). Also fixes the prior inconsistency where .env claimed `10.11.5-MariaDB` and .env.test claimed the EOL `mariadb-10.5.13`. - phpunit.yaml + doctrine.yaml: matrix-test on `mariadb:10.11` (LTS until 2028-02) and `mariadb:11.4`. `fail-fast: false` so a regression on one major doesn't mask the other. Both jobs are renamed to `... (matrix.mariadb.image)` for clarity in the Checks tab. - README: document `MARIADB_IMAGE` / `MARIADB_VERSION` overrides. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 456dcd5 commit 40814eb

7 files changed

Lines changed: 68 additions & 10 deletions

File tree

.env

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR
3535
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
3636
#
3737
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
38-
DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=10.11.5-MariaDB"
38+
# Doctrine's `serverVersion` controls the dialect, so it must match the
39+
# MariaDB you actually run. Default tracks the docker-compose default
40+
# (mariadb:11.4); override MARIADB_VERSION (and the matching MARIADB_IMAGE
41+
# in compose) to test against 10.11.
42+
MARIADB_VERSION=11.4.4-MariaDB
43+
DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=${MARIADB_VERSION}"
3944
#DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
4045
###< doctrine/doctrine-bundle ###
4146

.env.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SYMFONY_DEPRECATIONS_HELPER=999999
55
PANTHER_APP_ENV=panther
66
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
77

8-
DATABASE_URL="mysql://root:password@mariadb:3306/db_test?serverVersion=mariadb-10.5.13"
8+
DATABASE_URL="mysql://root:password@mariadb:3306/db_test?serverVersion=${MARIADB_VERSION}"
99

1010
###> lexik/jwt-authentication-bundle ###
1111
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem

.github/workflows/doctrine.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ env:
1919
jobs:
2020
validate-doctrine-shema:
2121
runs-on: ubuntu-latest
22-
name: Validate Schema
22+
strategy:
23+
# Don't cancel the 11.x leg if 10.x fails (or vice versa); we want to
24+
# see version-specific failures rather than mask one with the other.
25+
fail-fast: false
26+
matrix:
27+
mariadb:
28+
- image: mariadb:10.11
29+
version: 10.11.13-MariaDB
30+
- image: mariadb:11.4
31+
version: 11.4.4-MariaDB
32+
name: Validate Schema (${{ matrix.mariadb.image }})
33+
env:
34+
MARIADB_IMAGE: ${{ matrix.mariadb.image }}
35+
MARIADB_VERSION: ${{ matrix.mariadb.version }}
2336
steps:
2437
- name: Checkout
2538
uses: actions/checkout@v6
@@ -38,7 +51,7 @@ jobs:
3851
run: docker compose run --rm -e APP_ENV=prod phpfpm composer install --no-dev -o
3952

4053
- name: Run Doctrine Migrations
41-
run: docker compose run --rm -e APP_ENV=prod phpfpm bin/console doctrine:migrations:migrate --no-interaction
54+
run: docker compose run --rm -e APP_ENV=prod -e MARIADB_VERSION phpfpm bin/console doctrine:migrations:migrate --no-interaction
4255

4356
- name: Validate Doctrine schema
44-
run: docker compose run --rm -e APP_ENV=prod phpfpm bin/console doctrine:schema:validate
57+
run: docker compose run --rm -e APP_ENV=prod -e MARIADB_VERSION phpfpm bin/console doctrine:schema:validate

.github/workflows/phpunit.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,23 @@ env:
1919
jobs:
2020
phpunit:
2121
runs-on: ubuntu-latest
22-
name: PHP Unit tests
22+
strategy:
23+
# Don't cancel the 11.x leg if 10.x fails (or vice versa); we want to
24+
# see version-specific failures rather than mask one with the other.
25+
fail-fast: false
26+
matrix:
27+
mariadb:
28+
- image: mariadb:10.11
29+
version: 10.11.13-MariaDB
30+
- image: mariadb:11.4
31+
version: 11.4.4-MariaDB
32+
name: PHP Unit tests (${{ matrix.mariadb.image }})
33+
env:
34+
# Picked up by docker-compose.yml's `image: ${MARIADB_IMAGE:-…}`.
35+
MARIADB_IMAGE: ${{ matrix.mariadb.image }}
36+
# Forwarded into phpfpm via `-e MARIADB_VERSION` below; .env then
37+
# interpolates it into Doctrine's `serverVersion` URL parameter.
38+
MARIADB_VERSION: ${{ matrix.mariadb.version }}
2339
steps:
2440
- name: Checkout
2541
uses: actions/checkout@v6
@@ -38,7 +54,7 @@ jobs:
3854
run: docker compose run --rm phpfpm composer install
3955

4056
- name: PHP Unit - Test setup
41-
run: docker compose run --rm phpfpm composer run test-setup
57+
run: docker compose run --rm -e MARIADB_VERSION phpfpm composer run test-setup
4258

4359
- name: PHP Unit - Run tests
44-
run: docker compose run --rm phpfpm composer run test
60+
run: docker compose run --rm -e MARIADB_VERSION phpfpm composer run test

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ All notable changes to this project will be documented in this file.
77
- Fixed Calendar and Colibo feed configuration urls and added [] result when no locationEndpoint is set.
88
- Fixed baked-in `.env` shipping `APP_ENV=dev` in the API image; rewritten to `prod` at build time so
99
direct reads don't try to bootstrap a dev environment the prod-only dependencies can't satisfy.
10+
- Switched local dev MariaDB to upstream `mariadb:11.4` LTS (was `itkdev/mariadb:latest`); both 10.11
11+
and 11.4 LTS are now exercised by a CI matrix in the PHPUnit and Doctrine schema-validate workflows.
12+
`MARIADB_IMAGE` and `MARIADB_VERSION` env vars override the compose image and Doctrine
13+
`serverVersion`. Drops the previously-commented `ENCRYPT=1` toggle inherited from the itkdev wrapper.
1014

1115
## [3.0.0-rc2] - 2026-05-05
1216

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,22 @@ The fixtures have an editor user: <editor@example.com> with the password: "apass
145145

146146
The fixtures have the image-text template, and two screen layouts: "full screen" and "two boxes".
147147

148+
### Database (MariaDB)
149+
150+
Local dev defaults to `mariadb:11.4` (LTS until May 2029). CI also exercises `mariadb:10.11` (LTS until
151+
Feb 2028) via a matrix in `phpunit.yaml` and `doctrine.yaml`. Two env vars control the version:
152+
153+
- `MARIADB_IMAGE` — the docker image used by the `mariadb` compose service.
154+
- `MARIADB_VERSION` — the Doctrine `serverVersion` interpolated into `DATABASE_URL` in `.env` /
155+
`.env.test`. Must match the running server, or Doctrine will emit dialect-incompatible SQL.
156+
157+
To run the local stack against 10.11:
158+
159+
```shell
160+
docker compose down -v
161+
MARIADB_IMAGE=mariadb:10.11 MARIADB_VERSION=10.11.13-MariaDB docker compose up -d
162+
```
163+
148164
## Production setup
149165

150166
A JWT Auth keypair should be generated. See [JWT Auth](#jwt-auth).

docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ networks:
88

99
services:
1010
mariadb:
11-
image: itkdev/mariadb:latest
11+
# 11.4 is MariaDB's LTS series (supported until May 2029); 10.11 (LTS
12+
# until Feb 2028) is also tested in CI via the matrix in
13+
# .github/workflows/{phpunit,doctrine}.yaml. Override MARIADB_IMAGE
14+
# locally to test against 10.11; remember to set MARIADB_VERSION to
15+
# match (Doctrine uses it for dialect detection — see .env).
16+
image: ${MARIADB_IMAGE:-mariadb:11.4}
1217
networks:
1318
- app
1419
ports:
@@ -24,7 +29,6 @@ services:
2429
- MYSQL_USER=db
2530
- MYSQL_PASSWORD=db
2631
- MYSQL_DATABASE=db
27-
#- ENCRYPT=1 # Uncomment to enable database encryption.
2832

2933
phpfpm:
3034
image: itkdev/php8.4-fpm:latest

0 commit comments

Comments
 (0)