Skip to content

fix(hydra-gates): gate 64 reads an app id bound to a variable in the NC35 prelude - #856

Merged
rubenvdlinde merged 1 commit into
mainfrom
fix/gate-64-app-id-variable-prelude
Oct 16, 2026
Merged

rubenvdlinde merged 1 commit into
mainfrom
fix/gate-64-app-id-variable-prelude

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

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

main already recognises the NC35 prelude (an app's own spl_autoload_register() loader for OCA\OpenRegister\, since 20c2a57 on 6 Oct), but only when getAppPath() names the app as a literal or a class constant. larpinq's OpenRegisterAutoloader::register() takes ?string $appId = null, does $appId ??= 'openregister' and calls getAppPath($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.lock pins conduction/hydra-gates v1.18.0 (10 Sep), which predates the NC35 support entirely. A local run through vendor/ therefore fails decidiq, portaliq, shillinq, doriath and larpinq; CI takes the package at @main and only failed larpinq. That is where the apphost-prelude exclude comments came from. A new v1.x tag 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 by PreludeShapeFixtureTest:

fixture verdict
old-form (\OC_App::registerAutoloading('openregister', $p)) PASS
new-form (OpenRegisterAutoloader::register() + spl loader) PASS
decidiq-shape (decidiq lib/AppInfo at 03fdb9de, comments removed) PASS
larpinq-shape ($appId ??= 'openregister') PASS (RED on main)
no-prelude FAIL
name-only (a class named OpenRegisterAutoloader that registers nothing) FAIL
variable-other-app (variable bound to 'opencatalogi') FAIL

Plus decidiq-shape with its loader file removed (must FAIL) and a $appId = 'openregister' inside a string (must not count). Against main'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 OK
  • bash 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 on NODE_PATH is reported in a comment below.

Fleet check (app mounts, read only, exclude comments ignored)

app main this branch v1.18.0 (locked)
decidiq PASS PASS FAIL
portaliq PASS PASS FAIL
shillinq PASS PASS FAIL
doriath PASS PASS FAIL
larpinq FAIL PASS FAIL

The 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

…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.
@rubenvdlinde
rubenvdlinde merged commit 1cfd626 into main Oct 16, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant