Repository navigation
Conversation
One image (php:7.4-apache, Composer and gulp builds baked in) runs three roles chosen by command: the web app, scheduled jobs (supercronic) and a one-shot first-time setup. docker/docker-compose.yml runs them with MySQL 8.4; state is bind-mounted under docker/data/. - docker/Dockerfile: multi-stage build; falls back to archive.debian.org now that Debian 11 packages are leaving the main mirrors - docker/entrypoint.sh: waits for the database, writes msmtp's config from SMTP_* variables (SwiftMailer already sends through msmtp), warms the cache; migrations only when RUN_MIGRATIONS=1 - docker/init.sh: migrations, default data, card data clone and import, restricted lists, optional admin account; refuses to wipe a database that already has cards unless INIT_FORCE=1 - docker/docker-compose.dev.yml: dev environment, PHP/Twig bind-mounted from the checkout, Mailpit for mail - php.ini sets variables_order=EGPCS so container env vars reach Symfony under mod_php - TRUSTED_PROXIES set for a reverse proxy on the host - docker/README.md documents setup, updates, console commands and proxying Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWHJ1Ekh1MTES8JcxhiAzr
Drop the separate cron container: the app container's entrypoint now runs supercronic alongside Apache. If either process exits, the entrypoint stops the other and exits, so Docker restarts the container instead of leaving it serving pages without its jobs (or the reverse). docker stop still sends SIGWINCH, which is passed to Apache as a graceful stop. Also give the database a minute to shut down before Docker kills it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWHJ1Ekh1MTES8JcxhiAzr
tests/e2e drives the site in a real browser against the Docker stack, covering the main flows end to end: - registration with the confirmation email, login, logout, wrong password, password reset email (mail read from Mailpit) - building a deck in the deckbuilder, importing one from text, deleting - publishing a decklist; another user likes, favourites and comments - decklist search, the favourites list, public card and decklist API - public pages, and the Spanish site on the es. subdomain Every test fails on any JavaScript error or server error on the page. Each run registers its own two accounts, so runs don't depend on existing data. A separate project compares screenshots of key pages between two versions (baselines recorded locally, not committed). docker/docker-compose.e2e.yml runs the stack for the tests: production environment, served as localhost, all mail caught by Mailpit. Mailpit is pinned to v1.33.0 in both overlays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWHJ1Ekh1MTES8JcxhiAzr
Passing runs previously left nothing behind (screenshots and traces were kept only on failure). Now every test records a final full-page screenshot and a trace, and the specs attach named screenshots at key steps via snap(). Each run's HTML report goes in its own folder under reports/, named by local start time; npm run report opens the newest, npm run reports:clean keeps the newest 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWHJ1Ekh1MTES8JcxhiAzr
Symfony 4.4 and PHP 7.4 have been out of support since 2023 and 2022.
This moves straight to the current LTS (7.4: bug fixes to Nov 2028,
security fixes to Nov 2029) rather than stepping through 5.4 and 6.4.
Dependencies
- symfony/* 4.4 -> 7.4, with symfony/runtime and the standard 7.x kernel,
front controller and console
- Doctrine ORM 2.6 -> 2.20, DBAL 2 -> 3, DoctrineBundle 2.19, mapping by
attributes
- FOSUserBundle 2.2 -> 4.1; nelmio/api-doc-bundle 3 -> 5 (OpenAPI 3);
FOSJsRoutingBundle 3, BazingaJsTranslationBundle 8, Monolog 3,
PHPUnit 11, PHPStan 2
Replaced
- SwiftMailer -> symfony/mailer (MAILER_DSN). Also fixes two mail bugs:
review-comment notifications ($$mailer) and the "remind" confirmation
email (called a FOSUser method on the SwiftMailer service)
- FOSOAuthServerBundle -> league/oauth2-server-bundle. Same scopes and
ROLE_READ_DECK / ROLE_WRITE_DECK roles; endpoints /oauth/v2/authorize
(and the old /oauth/v2/auth) and /oauth/v2/token; a consent page asks
the user before a client is authorized. Needs an RSA key pair
(OAUTH_PRIVATE_KEY / OAUTH_PUBLIC_KEY). Existing OAuth2 clients must be
registered again (league:oauth2-server:create-client): the migration
keeps the old tables as legacy_fos_oauth_* but their client IDs don't
fit the new format, and old tokens stop working
- JMSI18nRoutingBundle -> Symfony's localized routes, with the same
hostname-per-language setup (en on APP_WEBSITE_URL, es on es.<host>);
the JSON APIs answer on any hostname
- sensio/framework-extra-bundle, doctrine/annotations: removed; routes,
Doctrine mapping, Gedmo and validation constraints are PHP attributes
(converted with Rector, rector.php)
Passwords: existing salted SHA-512 hashes keep working; new and changed
passwords use the current default algorithm.
Also: transchoice tags -> trans with %count%; deprecated DBAL fetch
methods; PHP 8.1-8.4 deprecations (Serializable, implicit nullable
parameters, "${var}" interpolation); PHPUnit tests on attributes and
static data providers ("api" group excluded by default, as in the old CI).
Known follow-ups, deprecated but working on 7.4: Request::get() calls
(removed in Symfony 8), Doctrine lazy ghost proxies (ORM 3 uses native
lazy objects).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QWHJ1Ekh1MTES8JcxhiAzr
- Docker image on php:8.4-apache; mail through MAILER_DSN instead of msmtp; OAuth2 key pair created on first start in docker/data/oauth; new "test" build stage with dev dependencies for PHPUnit - docker/check.sh (also "make check") runs PHPUnit, the lints (YAML, Twig, container, Doctrine mapping), PHPStan, PHP_CodeSniffer and the production image build, all through the test image, so the same checks run on any machine with Docker and from any CI that can run a shell script - Travis config removed: travis-ci.org shut down in 2021 and the config targeted PHP 7.4, which the code no longer runs on; README badge removed - Playwright: OAuth2 flow test (client registration, consent, code exchange, refresh, protected API, deny) - Dev container on PHP 8.4 / Node 22; README and Makefile updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWHJ1Ekh1MTES8JcxhiAzr
stopfstedt
self-requested a review
November 4, 2026 03:48
Collaborator
|
hey @ketura - thanks for the PR. this is coming in very timely - i've been finally working on a Symfony upgrade again, so Ii definitely want those changes. Not sure about the rest just yet (more Docker, playwright tests). i'll give it a close look in the next week or two, and take from here what's needed. in any case - much appreciated. |
Author
|
No problem at all! And yeah if you end up just cannibalizing the PR for another, that's fine too; just wanted to make sure I was giving back. Cheers! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Giving that I am forking this for the game community I manage (the LOTR-TCG), I found it prudent to give back with the initial upgrades I found necessary, namely bringing ThronesDB to a version of PHP and Symfony that are current, which is all the more necessary in this day and age of AI-riddled critical bugs.
Before the upgrade, I added a full Docker setup for hosting the entire application (not just for development in VSCode, which I see you have in the .devcontainer) and then set up some Playwright (GUI) tests that could be ran before and after the upgrade to ensure that basic functionality was still in place. Those tests covered registration, logging in, creating a deck, voting on and commenting on decks, importing decks, and several other structural features at a basic level. These could of course be expanded upon for future work.
Post-upgrade, there were a number of libraries which are now abandoned, out of service, or deprecated, which were replaced by the most standard equivalent I could identify. In particular travis.ci is no longer a thing for open source projects; it is replaced here with a script that covers similar testing, but it could be converted to a GitHub Action as well, which is not something I could just push over to this repo (the info for that is at the end if you'd prefer that, however).
These changes were executed at my direction by Claude Opus 5.5, who also drafted the below details. I stand by this upgrade as it is now at the heart of the fork that I will be running, and figure it might be useful to anyone following.
Summary
This PR brings ThronesDB onto supported versions and adds the tooling to run and check it:
The commits are in that order and each one builds and runs. The Docker setup and the test suite were committed and run on PHP 7.4 first, so the upgrade could be checked against the same tests and screenshots.
Why: end-of-life status
.envexample)docker/check.sh(see below)I went straight to 7.4 instead of 6.4 because 6.4 stops getting bug fixes on 30 Nov 2026. Stepping through 5.4 and 6.4 would also have meant migrating several bundles more than once, since their APIs changed at each major version.
What's in it
Docker (
docker/)php:<ver>-apacheimage runs either the web app or a one-shotinit. The web app container also runs the scheduled jobs (supercronic,docker/crontab) alongside Apache. If either process exits, the container exits and Docker restarts it.docker-compose.ymlruns the app plus MySQL 8.4. Both are published on 127.0.0.1 only, with state bind-mounted underdocker/data/and capped logs and memory limits.init. It runs migrations, loads default data, clones and imports the card data and restricted lists, and optionally creates an admin account. It refuses to wipe a database that already has cards unlessINIT_FORCE=1.docker-compose.dev.yml). Source and templates are bind-mounted from the checkout, and Mailpit catches mail.TRUSTED_PROXIESis set so a proxy on the host can terminate TLS.docker/README.mdcovers setup, updates, console commands and proxying.Browser tests (
tests/e2e/)es.<host>.docker-compose.e2e.ymlruns the stack for the tests.Upgrade
rector.phpincluded).ROLE_READ_DECK/ROLE_WRITE_DECKroles stay the same./oauth/v2/authorize, the old/oauth/v2/auth, and/oauth/v2/token.APP_WEBSITE_URL, Spanish ones.<host>). The JSON APIs answer on any hostname.Serializable, implicit nullable parameters,"${var}"interpolation.transchoice→transwith%count%.apigroup stays excluded by default, as before) and PHPStan 2.docker/check.sh(ormake check) runs PHPUnit, lint (YAML, Twig, container, Doctrine mapping), PHPStan, PHP_CodeSniffer and the production image build, all inside the Dockerfile's newteststage. They run the same way on any machine with Docker, and from any CI that can run a shell script..travis.yml,.env.travisand the README badge are deleted. travis-ci.org shut down in 2021, so the config hasn't run since. It also targets PHP 7.4, which this code no longer runs on, so keeping it would document a setup that no longer exists.Bugs fixed
The upgrade turned up three existing bugs:
ReviewControllercalled$$mailer(variable variable) instead of$mailer.{data: [...]}, and the test didn't account for that.Upgrade notes for deployers
MAILER_URLis replaced byMAILER_DSN(e.g.smtp://user:pass@host:587).OAUTH_PRIVATE_KEY/OAUTH_PUBLIC_KEY; theopensslcommands are in.env). The Docker setup creates one on first start.league:oauth2-server-client:create-client. The new bundle's client IDs are at most 32 characters and the old<id>_<random>IDs don't fit. The migration renames the old tables tolegacy_fos_oauth_*instead of dropping them. Existing tokens stop working.es.localhostinstead of/es/prefixes).Testing
docker/check.shpasses: PHPUnit (plus theapigroup run separately), PHPStan, PHP_CodeSniffer and all lints.initworks on the 8.4 image.If you want CI
This PR doesn't add a CI workflow. If you'd like one, this GitHub Actions file runs the same checks:
Known follow-ups
Two things are deprecated but still work on 7.4:
Request::get()calls, which are removed in Symfony 8.