The tests of a Nextcloud app run on the newest and the oldest PHP¶
Context¶
0035 runs the tools of a Nextcloud app, PHPUnit among them, on the PHP of config.platform.php of composer.json, 8.3 for a new app, and checks the oldest PHP of appinfo/info.xml, 8.2, only with the step Oldest PHP: php8.2 --syntax-check of what the app ships and composer check-platform-reqs. Psalm checks the code for PHP 8.2 as well. Nothing runs the code on 8.2, and no job runs a PHP newer than the tools, while Newest Python and Newest Node do that for the other kinds.
That let two real differences through. At their main of 2026-11-23, paperless-sync fails 10 tests of NextcloudStorageServiceTest on PHP 8.6.0, as fclose() now returns false when a flush fails, and paperless-unified-search 5, as the message of JsonException now ends with near location 1:1; both pass on 8.3 and 8.5. Nextcloud 33 to 35 still refuse PHP 8.6, so no user is affected yet, but its master accepts it.
On another PHP, the lock of an app installs on 8.2 to 8.6, as config.platform.php makes Composer resolve for the PHP of the tools and its check of the platform only asks for a PHP at least that old. PHPUnit 12 of the lock refuses 8.2, and php-cs-fixer refuses 8.6. PHPUnit 11.5, resolved for 8.2 in a copy, runs the tests of both apps, as phpunit.xml is written for PHPUnit 10.5 to 13.
Options¶
- A job on the newest PHP and one on the oldest in every pull request, as the step Oldest PHP runs: on the day a new PHP comes out, every open pull request turns red for a change that none of them made, and the resolve for the oldest PHP depends on Packagist on the day and takes up to two minutes.
scripts/check.shon the newest PHP: php-cs-fixer refuses a PHP newer than the syntax that it knows, so the job would fail for the tool, not for the app.- A workflow of its own on
mainand every week, with PHPUnit alone, like Newest Node: the newest PHP with the tools of the lock, the oldest with the newest PHPUnit that runs there, and one issue while the tests fail.
Decision¶
Option 3: the workflow Newest PHP, newest-php.yml, of the kind nextcloud-app only, after every push to main, every week in the slot of the repository and by hand; a newer push cancels the run before it. It is no required check, and the blueprint's own copy starts only by hand, as its jobs don't run there (0179).
tests (newest PHP)runsvendor/bin/phpunit --no-coveragewith the tools ofcomposer.lockon the newest PHP that the pinned setup-php sets up as a final release, and the summary names it. Notphp-version: latest: setup-php looks that up at the time of the run in the list of versions on its default branch, which named 8.6 from 2026-11-20 on, while the pinned 2.40.0 still sets up 8.6 as a development build of its branch. The job readslatestfrom the list of the pinned release, which GitHub downloads with the action, so the newest PHP moves with the pin that Renovate brings, about a week after setup-php released it. No nightly, master or release candidate: a development build fails for reasons of PHP itself.tests (oldest PHP)reads both PHPs as the CI does. When they are equal, its steps skip and its summary says why; composer.json belongs to the project, so every app has the job. Otherwise it sets up the oldest PHP and, in its own checkout, which nothing commits, removes the tools that the tests don't run (Psalm, php-cs-fixer, the coding standard, Infection), setsconfig.platform.phpto that PHP and lets PHPUnit be^10.5 || ^11.5beside the app's own constraint, of which Composer picks the newest that runs. A test that needs an API of a newer PHPUnit can fail for that reason, and the summary and the issue say so. When Composer finds no release for that PHP, it exits with 2, and the job names the package: then a person tests the oldest PHP another way or raisesmin-version. The job is needed only while the oldest Nextcloud of an app accepts a PHP older than its tools: Nextcloud 35 needs 8.3.- One issue, The tests fail with the newest or the oldest PHP, with the label
maintenance, as the other workflows of the newest versions keep: a failed PHPUnit, or a resolve that found nothing, opens it or brings it up to date with each PHP that failed, and the weekly run closes it once the newest passes and the oldest passes or has nothing to do. The job of the report blocks every host butapi.github.com. - A failure before the tests is none of the app's. setup-php and
composer installget a second try after 30 seconds, as the uploads got with 1096, and so does the resolve when Composer fails with another code than 2. When a download still fails at both tries, the job says in an error that nothing in the code is wrong, and the report changes nothing. Any other failure before the tests, such as a list of setup-php that a new release moved or a lock that doesn't install on the new PHP, comes back every time: it gets no such error and stays a plain failure, which the mails about red runs report. Extending 0141, the bot-health bot treats that error in a run of Newest PHP,BEFORE_THE_TESTS, as it treats a job that Harden-Runner stopped: it runs the failed jobs once more and opens no issue, after the last job of the run starts it, and in its daily look when that start failed.
Consequences¶
- The tests of paperless-sync at
32ff957, in Docker with the steps of the job, fail with the 10 errors ofNextcloudStorageServiceTeston PHP 8.6.0 and pass on 8.5.13; the job on a runner reaches 8.6 only with the release of setup-php after its commit2001cd3and Renovate's update of the pin. - A pull request costs no extra minute: both jobs run on
mainand every week only. While the issue is open, every push tomainmakes another red run with the same failure, as with Newest Python and Newest Node; something is left to do. - The resolve for the oldest PHP is neither locked nor reproducible, so a new release of a dev package can fail it between two weeks without a change of the app; the error names the package.
- The job reads the list of setup-php from where the runner keeps the actions of a job,
_actionsbeside the workspace. A runner that keeps them elsewhere fails the job before its tests, which says so and opens no issue.