fix(setup): detect Symfony on fresh deploys — var/cache cannot be the marker it creates - #137
Merged
Merged
Conversation
… marker it creates Framework detection required var/cache to exist before classifying an app as Symfony, but var/cache is exactly what setupSymfony() creates. A fresh deploy was therefore detected as generic, its cache directory never made, and the app failed health checks with an unwritable var/cache. Detection now corroborates bin/console with symfony.lock or a symfony/framework-bundle composer dependency. Laravel detection gets the same treatment (artisan plus composer dependency or bootstrap/app.php) so a stray artisan file no longer triggers Laravel permission handling.
sylvesterdamgaard
added a commit
to cboxdk/php-baseimages
that referenced
this pull request
Sep 7, 2026
…e skips, fixture repairs The full local run exposed suite bugs masking each other as image failures: - Runner: scenarios only cleaned up on success, so one failure leaked its compose stack and the shared ports (8090-8096) sank every later scenario. The runner now tears down the scenario's compose project AND any leftover e2e-* containers after every scenario, pass or fail. - Runner: chromium-only scenarios (browsershot, dusk-capabilities) are skipped with a message on images without Chromium instead of failing; the rootless scenario runs against ROOTLESS_IMAGE when provided and skips when the image under test is not rootless. - Scenarios: 32 VAR=$(docker exec ...) substitutions could kill a scenario mid-run under set -e before its own verdict; all now carry || true. - Pest fixture: three architecture tests genuinely failed (Calculator not final, missing strict_types, invalid ->or() chain) and the scenario's --filter='custom expectation' matched no test; fixture fixed and a CustomExpectationTest added. - Magento fixture: OpenSearch >=2.12 refuses to start without an admin password; use DISABLE_SECURITY_PLUGIN=true (which itself sets plugins.security.disabled - setting both is a startup error). - Rootless fixture: mounted public/ one level above the nginx docroot so every request 404'd; scenario also asserted pre-Docker-20.10 kernel behavior (unprivileged port-80 bind refusal) - now informational. - Symfony fixture: added the symfony.lock a Flex-managed app always has. - Fixture default images normalized to 8.5-bookworm-v1 channel tags (one had drifted to a nonexistent alpine tag). - entrypoint-lib.sh: Symfony detection accepts a symfony/framework-bundle composer dependency (not only symfony.lock), and fix_symfony_permissions creates var/cache + var/log instead of skipping when absent - mirrors cboxdk/init#137 where the same chicken-and-egg bug lived in cbox-init's detectFramework. Local verdict: 17 passed, 2 tier-skips on standard; chromium pair green against the chromium tier; rootless green against the rootless target.
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.
Problem
detectFramework()classified an app as Symfony only whenbin/consoleand an existingvar/cachedirectory were present. Butvar/cacheis exactly whatsetupSymfony()creates — chicken-and-egg: a fresh Symfony deploy (or bind mount withoutvar/) is detected as generic, its cache directory is never created, and the app fails health checks with an unwritablevar/cache.Found via the php-baseimages E2E suite: the Symfony scenario's app reported
cache: writable=falseforever because init loggedSetting up permissions framework=generic.Fix
bin/consolewithsymfony.lock(Flex-managed apps) or asymfony/framework-bundlecomposer dependency — markers every real Symfony app has before first boot.artisan+ composer dependency orbootstrap/app.php, which artisan itself requires) so a stray file namedartisanno longer triggers Laravel permission handling.entrypoint-lib.sh.Tests
TestDetectFrameworkextended: fresh-deploy Symfony withoutvar/, symfony.lock variant, composer-dependency variants for both frameworks, and negative cases (strayartisan, barebin/console).TestPermissionManager_SetupSymfony fixture now deliberately omitsvar/to prove Setup() creates it.go vetclean, golangci-lint v2.12.2: 0 issues, fullgo test ./...green.