Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Doctrine `serverVersion` for dialect selection — must match the running
# MariaDB. Default tracks the docker-compose default (mariadb:11.4);
# override MARIADB_VERSION (and the matching MARIADB_IMAGE in compose) to
# test against 10.11.
MARIADB_VERSION=11.4.4-MariaDB
# Database connection string for MariaDB/MySQL.
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=10.11.5-MariaDB"
DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=${MARIADB_VERSION}"
#DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

Expand Down
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots

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

###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,20 @@ env:
jobs:
validate-doctrine-shema:
runs-on: ubuntu-latest
name: Validate Schema
strategy:
# Don't cancel the 11.x leg if 10.x fails (or vice versa); we want to
# see version-specific failures rather than mask one with the other.
fail-fast: false
matrix:
mariadb:
- image: mariadb:10.11
version: 10.11.13-MariaDB
- image: mariadb:11.4
version: 11.4.4-MariaDB
name: Validate Schema (${{ matrix.mariadb.image }})
env:
MARIADB_IMAGE: ${{ matrix.mariadb.image }}
MARIADB_VERSION: ${{ matrix.mariadb.version }}
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -38,7 +51,7 @@ jobs:
run: docker compose run --rm -e APP_ENV=prod phpfpm composer install --no-dev -o

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

- name: Validate Doctrine schema
run: docker compose run --rm -e APP_ENV=prod phpfpm bin/console doctrine:schema:validate
run: docker compose run --rm -e APP_ENV=prod -e MARIADB_VERSION phpfpm bin/console doctrine:schema:validate
22 changes: 19 additions & 3 deletions .github/workflows/phpunit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,23 @@ env:
jobs:
phpunit:
runs-on: ubuntu-latest
name: PHP Unit tests
strategy:
# Don't cancel the 11.x leg if 10.x fails (or vice versa); we want to
# see version-specific failures rather than mask one with the other.
fail-fast: false
matrix:
mariadb:
- image: mariadb:10.11
version: 10.11.13-MariaDB
- image: mariadb:11.4
version: 11.4.4-MariaDB
name: PHP Unit tests (${{ matrix.mariadb.image }})
env:
# Picked up by docker-compose.yml's `image: ${MARIADB_IMAGE:-…}`.
MARIADB_IMAGE: ${{ matrix.mariadb.image }}
# Forwarded into phpfpm via `-e MARIADB_VERSION` below; .env then
# interpolates it into Doctrine's `serverVersion` URL parameter.
MARIADB_VERSION: ${{ matrix.mariadb.version }}
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -38,7 +54,7 @@ jobs:
run: docker compose run --rm phpfpm composer install

- name: PHP Unit - Test setup
run: docker compose run --rm phpfpm composer run test-setup
run: docker compose run --rm -e MARIADB_VERSION phpfpm composer run test-setup

- name: PHP Unit - Run tests
run: docker compose run --rm phpfpm composer run test
run: docker compose run --rm -e MARIADB_VERSION phpfpm composer run test
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ All notable changes to this project will be documented in this file.
`SESSION_HANDLER_DSN=` empty to fall back to PHP's native file handler. Removes the per-session
`flock` that serialised parallel session-touching requests and lets sessions survive container
restarts; multi-pod deployments now share session state without sticky routing.
- Switched local dev MariaDB to upstream `mariadb:11.4` LTS (was `itkdev/mariadb:latest`); both 10.11
and 11.4 LTS are now exercised by a CI matrix in the PHPUnit and Doctrine schema-validate workflows.
`MARIADB_IMAGE` and `MARIADB_VERSION` env vars override the compose image and Doctrine
`serverVersion`. Drops the previously-commented `ENCRYPT=1` toggle inherited from the itkdev wrapper.

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

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,22 @@ The fixtures have an editor user: <editor@example.com> with the password: "apass

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

### Database (MariaDB)

Local dev defaults to `mariadb:11.4` (LTS until May 2029). CI also exercises `mariadb:10.11` (LTS until
Feb 2028) via a matrix in `phpunit.yaml` and `doctrine.yaml`. Two env vars control the version:

- `MARIADB_IMAGE` — the docker image used by the `mariadb` compose service.
- `MARIADB_VERSION` — the Doctrine `serverVersion` interpolated into `DATABASE_URL` in `.env` /
`.env.test`. Must match the running server, or Doctrine will emit dialect-incompatible SQL.

To run the local stack against 10.11:

```shell
docker compose down -v
MARIADB_IMAGE=mariadb:10.11 MARIADB_VERSION=10.11.13-MariaDB docker compose up -d
```

## Production setup

A JWT Auth keypair should be generated. See [JWT Auth](#jwt-auth).
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ networks:

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

phpfpm:
image: itkdev/php8.4-fpm:latest
Expand Down
Loading