Repository navigation
fix(php): store the concrete version for --php=latest - #127
Conversation
A site created with --php=latest was stored as `latest`, which follows the default PHP version: after a default bump, the next compose regeneration moves it to the new image while it keeps the PHP config of the old one (SC-60). create() now stores DEFAULT_PHP_VERSION (8.5) instead, so the compose file, custom.ini and the sites row all get the concrete version. --php=latest is still accepted, and rows that still say `latest` keep running the default image. Behat: the `latest` example of "Create a php site on every supported PHP version" expects php_version 8.5.
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
What
ee site create --type=php --php=latestnow stores the concrete default version (PHP::DEFAULT_PHP_VERSION, 8.5 today) in thesitestable instead oflatest.--php=latestis still accepted as an input.Why
A stored
latestfollows the default PHP version. When the default moves (8.4 → 8.5 in v4.15.0), the next compose regeneration (ee site refresh, any update that rewritesdocker-compose.yml) moves such a site to the new image, while itsconfig/phpwas generated for the old one: startup warnings for extensions the new image doesn't have or builds in (SC-60). EasyEngine/site-command#541 pins the existinglatestrows once; without this change, every newlatestsite would hit the same problem at the next default bump.Change
create()resolveslatesttoself::DEFAULT_PHP_VERSIONright after the supported-version check, so everything downstream sees the concrete value: thephp.ini-56choice, the compose filter, and thesitesrow. Thelatest→easyengine/php<default>mapping inSite_PHP_Docker.phpstays for rows that still saylatest.--phpphp_version8.5easyengine/php8.5latest8.5(waslatest)easyengine/php8.55.6…8.6easyengine/php<v>latest(older release)easyengine/php8.5For a new
latestsite,ee site update --php=8.5now saysSite <site> is already at PHP version: 8.5(it used to redo the switch to the same image), and--php=8.4backs the config up to.backup/config/php-8.5(wasphp-latest).ee site update --php=latestis still refused by the update options: there is nophplatest.zipconfig to switch to.The help text is unchanged:
latestis still a valid--phpvalue.Readers of
php_versioncheckedee site update --php(site-command): "already at" check and backup dir name, as above.ee site clone(site-command): passes the source's stored version as--php, so a clone of a newlatestsite gets--php=8.5; a source row that still sayslatestis cloned with--php=latestand the clone stores 8.5. Onlyapp/htdocsis copied; the clone's PHP config is generated for its own version.phpVersion): records the stored value, now 8.5.ee site info: only--format=jsonshowsphp_version(now 8.5); the table has no PHP row.drop_deprecated_session_sid_settingsmigration (8.4,8.5,latest) andpin_latest_php_versionmigration: unaffected (they act on existing rows).php -vforlatestrows, which new sites no longer have.A site on PHP "latest" is posted with the version it really runscreates its fixture with--type=php --php=latestand expects alatestrow. Its CI installs site-type-* atdev-develop, so test(behat): seed the latest PHP row instead of creating it dash-command#5 seeds that row directly instead (merged right after this).Tests
latestexample of "Create a php site on every supported PHP version" now expectsphp_version8.5 (newstoredcolumn).latestis stored asDEFAULT_PHP_VERSION, and the compose file,custom.iniand thesitesrow written from it get 8.5; they fail without this change and pass with it, and fail whenlatestresolves to any other version.Summary by CodeRabbit
latest. It resolves to the current default PHP version, 8.5, which is stored for the site and used in its configuration. Explicitly selected PHP versions continue to be stored and used as selected.