Repository navigation
fix(hydra-gates): gate 64 reads an app id bound to a variable in the NC35 prelude - #856
Merged
Merged
Conversation
…NC35 prelude The Nextcloud 35 prelude (an app's own spl_autoload_register() loader for OCA\OpenRegister\) was recognised only when getAppPath() named 'openregister' as a literal or a class constant. larpinq's OpenRegisterAutoloader takes `?string $appId = null`, does `$appId ??= 'openregister'` and calls getAppPath($appId), so gate 64 failed it for a prelude it runs. has_spl_prelude() now also accepts a variable bound to 'openregister' in the same file (`=`, `??=` or a parameter default), read from code only. Adds on-disk fixtures for every prelude shape the fleet ships: the old OC_App::registerAutoloading() form, the new OpenRegisterAutoloader::register() form, decidiq's real lib/AppInfo code, larpinq's variable shape, and three controls that must stay red (no prelude, a class only NAMED OpenRegisterAutoloader, a variable bound to another app). Plus decidiq with its loader removed, which must go red.
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.
What
Gate 64 (apphost-autoload-prelude) now accepts the Nextcloud 35 prelude when the app id reaches
getAppPath()through a variable bound to'openregister'in the same file ($appId = ...,$appId ??= ..., or a parameter default).Why
mainalready recognises the NC35 prelude (an app's ownspl_autoload_register()loader forOCA\OpenRegister\, since 20c2a57 on 6 Oct), but only whengetAppPath()names the app as a literal or a class constant. larpinq'sOpenRegisterAutoloader::register()takes?string $appId = null, does$appId ??= 'openregister'and callsgetAppPath($appId), so gate 64 still failed larpinq for a prelude it runs.Context for the "gate 64 fails every NC35 app" report
The apps'
composer.lockpinsconduction/hydra-gatesv1.18.0 (10 Sep), which predates the NC35 support entirely. A local run throughvendor/therefore fails decidiq, portaliq, shillinq, doriath and larpinq; CI takes the package at@mainand only failed larpinq. That is where theapphost-prelude excludecomments came from. A newv1.xtag plus a fleet bump would stop local runs disagreeing with CI.Tests
On-disk fixtures under
hydra-gates/scripts/test-fixtures/apphost-prelude-shapes/, one per shape, asserted byPreludeShapeFixtureTest:old-form(\OC_App::registerAutoloading('openregister', $p))new-form(OpenRegisterAutoloader::register()+ spl loader)decidiq-shape(decidiq lib/AppInfo at 03fdb9de, comments removed)larpinq-shape($appId ??= 'openregister')main)no-preludename-only(a class namedOpenRegisterAutoloaderthat registers nothing)variable-other-app(variable bound to'opencatalogi')Plus decidiq-shape with its loader file removed (must FAIL) and a
$appId = 'openregister'inside a string (must not count). Againstmain's checker the new tests fail on exactly the larpinq shape and the string case.python3 hydra-gates/scripts/lib/test_check_apphost_autoload_prelude.py: 60 tests OKbash hydra-gates/tests/run-helper-suites.sh: first run reached 102 suites with no failure other than three suites that need ajv (not installed locally) before a session restart killed it; a rerun with ajv onNODE_PATHis reported in a comment below.Fleet check (app mounts, read only, exclude comments ignored)
mainThe exclude comments in portaliq, doriath and shillinq are now redundant; removing them is a per-app follow-up, not part of this PR.
AI disclosure: prepared with Claude Code (Claude Opus 5.5) and reviewed before merge.
🤖 Generated with Claude Code