wikimedia/toolforge-bundle
Symfony bundle for running applications on Wikimedia Toolforge. Provides ready-made integration with Toolforge services like MySQL, Redis, and Kubernetes, plus configuration helpers that simplify deploying and operating Symfony apps on the platform.
Architecture fit. This is a Symfony bundle, not a framework-agnostic library. It hooks into Symfony's bundle registration, DI container, Configuration tree, and event system. A Laravel application cannot composer require it and get value — there is no service provider bridge, no config/toolforge.php, and no way to consume its services without booting a Symfony kernel. Fit against a Laravel/PHP stack is therefore low at the package level, moderate at the pattern level. Its real content is a codified set of conventions for running a web tool on Wikimedia Toolforge: OAuth handshake against Wikimedia's identity provider, connections to the Toolforge MariaDB replicas and Redis, logging that satisfies Toolforge's log-collection expectations, and liveness/shutdown endpoints. Those concerns recur in any Laravel tool deployed to Toolforge, but the code is not reusable as-is.
Integration feasibility. Two paths, both with caveats. (1) Adopt the bundle directly — requires the tool itself to be Symfony 4/5, which rules out Laravel entirely; viable only if we stand up a small Symfony service next to the Laravel app, which introduces a second runtime, second deploy pipeline, and cross-app session/auth coordination for marginal benefit. (2) Port the patterns — reimplement the same concerns as a first-party Laravel package (service provider + config + Socialite driver for Wikimedia OAuth + DB/Redis connection presets + health endpoint). This is the realistic option and is bounded work, but it means the dependency becomes reference material, not code in the supply chain.
Technical risk.
symfony/*: ^4|^5, it is uninstallable in any current project.Key questions.
composer.json actually allow, and is there any test matrix beyond 4/5?Stack fit. Poor for direct use, good as a specification. Treat the bundle as the authoritative description of "what a well-behaved Toolforge web tool does in PHP," then satisfy that description idiomatically in Laravel.
Mapping. The expected surface area — verify each during the spike — maps as follows:
| Bundle concern | Laravel equivalent |
|---|---|
| Wikimedia OAuth consumer | Custom Socialite driver against Meta's OAuth endpoints |
| Toolforge DB replica connections | config/database.php presets pointing at the *.db.svc.wikimedia.cloud replica hosts, read-only |
| Redis / Memcached wiring | Native Laravel cache/queue drivers with Toolforge host presets |
| Logging to collected stdout/stderr | stderr log channel; disable file rotation |
| Liveness / graceful shutdown | /healthz route plus queue-worker drain on SIGTERM |
| i18n gadget integration | Optional middleware writing the expected cookie/param |
Migration path. Do not attempt a big-bang integration. Run a short, time-boxed spike: scaffold a throwaway Symfony app with the bundle on Toolforge, observe what it actually configures, and diff that against our Laravel defaults. That spike is the deliverable — a written spec. Then build an internal laravel-toolforge package (service provider, config stub, Socialite driver, health route). Internal-only, no distribution, avoids the GPL question entirely.
Compatibility. Two compatibility surfaces to pin: Symfony version support (for the spike) and Toolforge platform contract (ingress TLS termination, X-Forwarded-* trust, container memory limits, replica connection caps). The latter is the one that actually breaks deployments; the bundle only encodes it. Validate against Toolforge's own documentation rather than assuming the bundle is current.
Sequencing.
Budget: one engineer, roughly one to two weeks for steps 1–5 if the bundle's surface is as small as it appears.
Maintenance. As a reference implementation, near-zero: we own our port and are not exposed to the upstream's Symfony version treadmill. As a direct dependency, the burden is real — we inherit EOL framework constraints and a support relationship with a small Wikimedia team whose priorities are their own tools. The port is the lower-lifetime-cost option despite higher upfront cost.
Support. Expect Phabricator, not GitHub issues, and Wikimedia movement norms around responsiveness. There is no commercial support, no SLA, no security advisory feed we can subscribe to in the way we would for a vendor package. For a dependency this small, that is tolerable; it is not tolerable for anything on a customer-facing critical path.
Scaling. Constrained by Toolforge, not by the bundle. Relevant ceilings: per-user connection limits on the database replicas (commonly single digits), read-only replicas with replication lag, container memory limits on the webservice, and the Kubernetes restart behavior on failed health checks. A Laravel app is heavier at boot than a minimal Symfony app — opcache preloading, config/route caching, and a trimmed service provider set matter more here than in a typical deployment. Queue workers need explicit SIGTERM draining or jobs get killed mid-flight on redeploy.
Failure modes. Ranked by likelihood:
http:// URLs behind Toolforge's TLS-terminating ingress, breaking redirects and cookies.Ramp-up. Two distinct knowledge gaps: Symfony bundle internals (needed only for the spike — a mid-level PHP engineer can read it in a day or two) and Toolforge platform behavior (the durable one — ingress contract, replica topology, job scheduling, resource limits). Plan for the platform knowledge to live with whoever owns deployment, and write it down; it is not discoverable from the bundle's README.
Recommendation. Do not add wikimedia/toolforge-bundle to the dependency graph. Use it as a one-time specification for a small internal Laravel package. Revisit only if the project's center of gravity moves to Symfony, or if upstream publishes a framework-neutral library of the same concerns.
How can I help you explore Laravel packages today?