ci(playwright): give Nextcloud a cache backend — there was none at all - #573
Merged
Conversation
This workflow is 7k lines and configures no cache: no `memcache.*`, and no
cache extension in any `setup-php`. Nextcloud has none unless one is
configured, so `ICacheFactory::createDistributed()` handed every caller a null
cache and nothing survived from one HTTP request to the next. No real instance
runs that way, and it silently changes the behaviour of anything session- or
cache-backed.
MEASURED ON filinq
OpenRegister's McpProtocolService keeps MCP sessions in
`$cacheFactory->createDistributed(...)`. Every JSON-RPC call therefore arrived
without its session, and the whole agent-document-editing suite (6 tests) stood
down with:
"the MCP session does not survive between requests on this instance …
OpenRegister stores sessions in a cache and this harness has no cache
backend. These specs pass against a real instance."
That skip was correct about the environment. The environment was the defect.
WHAT THIS ADDS
* `apcu` to the Playwright job's PHP extensions, plus
`ini-values: apc.enable_cli=1` — `php -S` IS the CLI SAPI, and without that
flag APCu loads but stays inert, which looks exactly like never having
installed it.
* A "Configure the Nextcloud cache backend" step, immediately after
`maintenance:install` and before the app under test is enabled, setting
`memcache.local` and `memcache.distributed` to `\OC\Memcache\APCu`.
APCu for BOTH tiers, which is right here and would be wrong in production: this
job is a single `php -S` process tree on one runner, so "local" and
"distributed" are the same memory, and forked workers inherit APCu's shared
segment.
The step FAILS LOUDLY if apcu is missing or disabled rather than proceeding
without a cache, because a silently absent cache is the exact failure being
fixed. Guard verified in both directions locally: the apcu form exits 1 where
apcu is absent, and the same shape exits 0 for an extension that is present.
Scoped to the Playwright job. The newman and phpunit jobs have the same gap and
are deliberately left for a follow-up: this is the one with a measured
consequence, and a shared workflow that all 18 fleet apps run should change one
job at a time.
YAML re-parsed after the edit: the new step is index 6 of 32, between "Install
Nextcloud" and "Cache Composer downloads".
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.
There was no cache backend at all
This workflow is 7k lines and configures none: no
memcache.*, and no cacheextension in any
setup-php. Nextcloud has no cache unless one is configured,so
ICacheFactory::createDistributed()handed every caller a null cache andnothing survived from one HTTP request to the next.
No real instance runs that way, and it silently changes the behaviour of
anything session- or cache-backed.
Measured on filinq
OpenRegister's
McpProtocolServicekeeps MCP sessions in$cacheFactory->createDistributed(...). Every JSON-RPC call therefore arrivedwithout its session, and the whole
agent-document-editingsuite (6 tests)stood down with:
That skip was correct about the environment. The environment was the defect.
What this adds
apcuin the Playwright job's extensionsini-values: apc.enable_cli=1—php -Sis the CLI SAPI, and without that flag APCu loads but stays inert, which looks exactly like never having installed itConfigure the Nextcloud cache backendstepmaintenance:install, before the app under test is enabled; setsmemcache.localandmemcache.distributedAPCu for both tiers — right here, wrong in production: this job is a single
php -Sprocess tree on one runner, so "local" and "distributed" are the samememory, and forked workers inherit APCu's shared segment.
The step fails loudly if apcu is missing or disabled rather than proceeding
without a cache, because a silently absent cache is the exact failure being
fixed. Guard verified in both directions locally: the apcu form exits 1 where
apcu is absent, and the same shape exits 0 for an extension that is present.
Scope
Deliberately the Playwright job only. The newman and phpunit jobs have the
same gap and are left for a follow-up — this is the one with a measured
consequence, and a shared workflow that all 18 fleet apps run should change one
job at a time.
YAML re-parsed after the edit: the new step is index 6 of 32, between "Install
Nextcloud" and "Cache Composer downloads".
Surfaced by the e2e skip-discipline gate, #559.