feat: upgrade Symfony 7.4 → 8.1, drop runtime/frankenphp-symfony #11

Open
lyra wants to merge 4 commits from feat/symfony-8.1-upgrade-plan into main
Member

Upgrades preauth from Symfony 7.4 → 8.1 and removes the now-redundant runtime/frankenphp-symfony package — symfony/runtime 8.1 handles FrankenPHP worker mode natively via its built-in FrankenPhpWorkerRunner.

Full plan with per-phase results and rollback notes: docs/symfony-8.1-upgrade-plan.md

Changes

composer (commit c743a1b)

  • All symfony/* constraints 7.4.*8.1.* (resolved: framework-bundle 8.1.6, twig-bundle 8.1.2, console/cache/mime/rate-limiter/runtime/uid/yaml 8.1.x)
  • Removed runtime/frankenphp-symfony + the extra.runtime class override — the default runtime auto-detects FrankenPHP worker mode
  • extra.symfony.require8.1.*; ride-alongs: phpunit 13.3.2, twig 3.28, otphp 11.5

worker recycle parity (commit baf976a)

  • The removed package restarted the worker after FRANKENPHP_LOOP_MAX requests (default 500). The built-in runner doesn't, so we restore it natively:
    • Caddyfile: global frankenphp block with max_requests {$MAX_REQUESTS} — per-thread graceful restarts, other threads keep serving
    • Dockerfile: ARG/ENV MAX_REQUESTS=500 bakes in the same default as the old package, overridable at build time or runtime (-e MAX_REQUESTS=N, 0 = unlimited)
    • Stock FRANKENPHP_CONFIG env var remains available as a full-configuration escape hatch

docs (commits 3f1778c, af4d2a4, baf976a)

  • Upgrade plan document with per-phase results recorded
  • CHANGELOG Unreleased entries; readme env table + docs/example.env document MAX_REQUESTS
  • ROADMAP / bin/dev.sh stack references updated

Verification

Check Result
Deprecation sweep on 7.4 (failOnDeprecation suite) zero deprecations — no app code changes needed
bin/console about boots on Symfony v8.1.6
Test suite 295 tests / 612 assertions green
prod cache:clear + cache:warmup
lint:container / lint:yaml / lint:twig
php-cs-fixer 0 fixable files
Worker-mode state audit all src/ services are final readonly, constructor-injected, no mutable state — safe under kernel reuse
Worker recycle behavior restored: max_requests 500 default via MAX_REQUESTS (same default the old package enforced)

Remaining (out of scope for this PR)

  • Phase 4: staging smoke test with a built image (needs Docker host) — includes confirming threads actually recycle after 500 requests under worker mode
  • Phase 5: tag/release after merge
Upgrades preauth from Symfony **7.4 → 8.1** and removes the now-redundant `runtime/frankenphp-symfony` package — `symfony/runtime` 8.1 handles FrankenPHP worker mode natively via its built-in `FrankenPhpWorkerRunner`. Full plan with per-phase results and rollback notes: `docs/symfony-8.1-upgrade-plan.md` ## Changes **composer (commit `c743a1b`)** - All `symfony/*` constraints `7.4.*` → `8.1.*` (resolved: framework-bundle 8.1.6, twig-bundle 8.1.2, console/cache/mime/rate-limiter/runtime/uid/yaml 8.1.x) - Removed `runtime/frankenphp-symfony` + the `extra.runtime` class override — the default runtime auto-detects FrankenPHP worker mode - `extra.symfony.require` → `8.1.*`; ride-alongs: phpunit 13.3.2, twig 3.28, otphp 11.5 **worker recycle parity (commit `baf976a`)** - The removed package restarted the worker after `FRANKENPHP_LOOP_MAX` requests (default 500). The built-in runner doesn't, so we restore it natively: - `Caddyfile`: global `frankenphp` block with `max_requests {$MAX_REQUESTS}` — per-thread graceful restarts, other threads keep serving - `Dockerfile`: `ARG/ENV MAX_REQUESTS=500` bakes in the same default as the old package, overridable at build time or runtime (`-e MAX_REQUESTS=N`, `0` = unlimited) - Stock `FRANKENPHP_CONFIG` env var remains available as a full-configuration escape hatch **docs (commits `3f1778c`, `af4d2a4`, `baf976a`)** - Upgrade plan document with per-phase results recorded - CHANGELOG Unreleased entries; readme env table + `docs/example.env` document `MAX_REQUESTS` - ROADMAP / bin/dev.sh stack references updated ## Verification | Check | Result | |---|---| | Deprecation sweep on 7.4 (failOnDeprecation suite) | ✅ zero deprecations — no app code changes needed | | `bin/console about` | ✅ boots on Symfony v8.1.6 | | Test suite | ✅ **295 tests / 612 assertions green** | | prod `cache:clear` + `cache:warmup` | ✅ | | `lint:container` / `lint:yaml` / `lint:twig` | ✅ | | php-cs-fixer | ✅ 0 fixable files | | Worker-mode state audit | ✅ all `src/` services are `final readonly`, constructor-injected, no mutable state — safe under kernel reuse | | Worker recycle behavior | ✅ restored: `max_requests 500` default via `MAX_REQUESTS` (same default the old package enforced) | ## Remaining (out of scope for this PR) - Phase 4: staging smoke test with a built image (needs Docker host) — includes confirming threads actually recycle after 500 requests under worker mode - Phase 5: tag/release after merge
lyra added 3 commits 2026-09-07 22:47:35 -04:00
Covers deprecation sweep gate, composer.json constraint bumps to 8.1.*,
and removal of runtime/frankenphp-symfony (FrankenPHP worker mode is
handled natively by symfony/runtime in 8.x). Includes config recipe
re-sync, Docker/CI notes, phased rollout with rollback, and open
questions (kernel-reset audit for worker mode).
- All symfony/* constraints bumped 7.4.* -> 8.1.* (resolved to 8.1.2-8.1.6)
- Removed runtime/frankenphp-symfony: symfony/runtime 8.1 handles
  FrankenPHP worker mode natively via FrankenPhpWorkerRunner; deleted
  the extra.runtime class override so GenericRuntime auto-detects it
- phpunit 13.3.2, twig 3.28, otphp 11.5 ride along
- Deprecation sweep on 7.4 was clean (failOnDeprecation suite, zero hits)
- Verified: bin/console about boots on 8.1.6; 295 tests / 612 assertions
  green after the bump
- Plan doc: mark Phases 0-3 + worker-mode state audit complete with
  verified results; resolve open questions (all src/ services are final
  readonly - no ResetInterface needed under kernel-reusing runner)
- CHANGELOG: Unreleased entries for the 8.1 bump and the
  runtime/frankenphp-symfony removal (incl. FRANKENPHP_LOOP_MAX note)
- ROADMAP: current stack now Symfony 8.1; webauthn research note updated
- bin/dev.sh: correct stale PHP requirement comment
lyra added 1 commit 2026-09-08 06:15:28 -04:00
The removed runtime/frankenphp-symfony package force-restarted the
worker after FRANKENPHP_LOOP_MAX requests (default 500) - memory-leak
paranoia the built-in 8.1 runner intentionally doesn't reimplement.

Restore the behavior natively so the upgrade is a no-op operationally:
- Caddyfile: global frankenphp block with max_requests {$MAX_REQUESTS}
  - per-thread graceful restarts, other threads keep serving
- Dockerfile: ARG/ENV MAX_REQUESTS=500 bakes the same default the old
  package had, overridable at docker build or runtime (-e, 0 disables)
- Stock FRANKENPHP_CONFIG env var remains the full-config escape hatch
- Documented in readme env table, docs/example.env, CHANGELOG, and the
  upgrade plan (phase-4 staging note now checks thread recycling)
All checks were successful
Tests / test (pull_request) Successful in 1m4s
This pull request doesn't have enough required approvals yet. 0 of 1 approvals granted from users or teams on the allowlist.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/symfony-8.1-upgrade-plan:feat/symfony-8.1-upgrade-plan
git checkout feat/symfony-8.1-upgrade-plan
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: public/preauth#11