Timeline:
- Decouple mwscript-k8s MediaWiki image selection from mw-web.
- Support PHP version selection in mwscript-k8s
- Announce upcoming change to default to PHP 8.1 (2025-03-26)
- Update https://wikitech.wikimedia.org/wiki/Maintenance_scripts to highlight the PHP default version change and fallback
- Change default PHP version to 8.1 with fallback option to 7.4 (2025-04-02)
Implementation notes:
Currently, the mwscript-k8s tool determines which mediawiki image to use by simply following the one used by mw-web/main.
While that works, there's one caveat in the context of the 8.1 migration: If we take no action, when mw-web/main is converted to 8.1 in the near future, all mwscript-k8s use cases will implicitly be migrated as well. That's less than ideal.
I was chatting with @RLazarus the other day, and we discussed a more structured migration, where there will in the future be a (advertised) day where mwscript-k8s invocations switch to 8.1 by default, but with an escape hatch for users that experience issues with their scripts: a command-line flag to revert to a 7.4-based image. There would then be a later date when the flag is removed.
Achieving this would require decoupling the tool from mw-web/main. One idea for doing that would be to imbue scap with a notion of non-deploy helmfile releases - i.e., scap is only responsible for maintaining the files in /etc/helmfile-defaults/mediawiki/release, but does not attempt to "actuate" (e.g., helmfile apply) a deployment.
We could then configure 7.4- and 8.1- associated non-deploy releases in the mw-script namespace, whose release-values files would instead be consumed by the tool.
This could be broadly useful for other "asynchronous deployment" use cases that want to follow (by some other mechanism) the latest deployed images, and intersects a bit with some of the discussion in T375497 around when new image versions are "published" to /etc/helmfile-defaults/mediawiki/release.